ExamplesNodes

Custom Nodes

Creating your own nodes is as easy as creating a regular Svelte component and passing them to nodeTypes. Being just regular components, you can essentially display any content and implement any functionality you like. Inside, you have access to a number of props that let you implement and extend default node behaviour.

<script lang="ts">
const data: string = "world";
</script>

<h1>Hello {data}</h1>

<style>
h1 {
  font-size: 1.5rem;
}
</style>
Read-only
⚠️
To surpress unknown prop warnings in the browser console, please refer to the guide.