Skip to Content
💡 Legacy Notice: You're viewing Svelte Flow for Svelte 4. For the latest documentation, click here.
ExamplesMiscThrelte Flow

Threlte Flow

You may have noticed that the hero flow on our our homepage is actually written in React 🙈. For all the non-believers, here it is written in Svelte with help from the amazing Threlte library .

<script lang="ts"> import { writable } from 'svelte/store'; import { SvelteFlow, Background, type Node, type Edge } from '@xyflow/svelte'; import '@xyflow/svelte/dist/style.css'; import { initialNodes, initialEdges } from './nodes-and-edges'; import ColorPickerNode from './ColorPickerNode.svelte'; import SliderNode from './SliderNode.svelte'; import ThrelteNode from './ThrelteNode.svelte'; import SwitcherNode from './SwitcherNode.svelte'; const nodes = writable<Node[]>(initialNodes); const edges = writable<Edge[]>(initialEdges); const nodeTypes = { colorpicker: ColorPickerNode, slider: SliderNode, hero: ThrelteNode, switcher: SwitcherNode, }; </script> <SvelteFlow {nodes} {nodeTypes} {edges} fitView> <Background /> </SvelteFlow>
To suppress unknown prop warnings in the browser console, please refer to the guide.
Last updated on