Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
10760fb
Align quick start and installation
0x0f0f0f Mar 16, 2026
a59676b
add edge labels and handles pages, move pro example
0x0f0f0f Mar 17, 2026
2a5e747
make it build
0x0f0f0f Mar 17, 2026
44fd3b2
share the tables between packages
0x0f0f0f Mar 18, 2026
9443e7b
dont use hook in toplevel
0x0f0f0f Mar 23, 2026
eed75ec
Add concepts to Svelte flow. Fix some RF docs and add links
0x0f0f0f Mar 24, 2026
ee6512f
add the flows (not implemented) to the viewport page
0x0f0f0f Mar 24, 2026
7a8f29b
add zoom pan flows to svelte flow
0x0f0f0f Mar 24, 2026
6de7d20
apply some suggestions
0x0f0f0f Mar 24, 2026
f6ab8a2
grammar
0x0f0f0f Mar 24, 2026
85ab44e
fix redirect
0x0f0f0f Mar 24, 2026
3526f62
add utility classes page and fix various issues
0x0f0f0f Mar 25, 2026
985bfcf
Merge branch 'staging' into align-svelte-react-learn-sections
peterkogo Mar 26, 2026
cacbd1e
merge staging
peterkogo Mar 26, 2026
7102e7a
remove prop destructuring
0x0f0f0f Mar 30, 2026
1dfe72a
align the building-a-flow tutorial
0x0f0f0f Mar 31, 2026
a6c830a
fix typo
0x0f0f0f Mar 31, 2026
9bd45d3
apply suggestions
0x0f0f0f Apr 1, 2026
b4a556e
further improvements and fixes to guides
0x0f0f0f Apr 1, 2026
8610786
move more example apps to correct structure and fix css
0x0f0f0f Apr 1, 2026
491f3c0
adjust slug
0x0f0f0f Apr 1, 2026
59ad845
Merge remote-tracking branch 'origin/staging' into align-svelte-react…
0x0f0f0f Apr 1, 2026
0983af5
align layout page
0x0f0f0f Apr 2, 2026
5205dc5
adjust component
0x0f0f0f Apr 2, 2026
54115e5
move last example in guides directory to learn (example is unused)
0x0f0f0f Apr 2, 2026
f1a734c
add dark mode information to theming
0x0f0f0f Apr 2, 2026
fe2d0d4
move section
0x0f0f0f Apr 2, 2026
86884a6
move section again
0x0f0f0f Apr 2, 2026
6d7dd8e
fix the theming class names table
0x0f0f0f Apr 2, 2026
f98a18b
apply suggestions
0x0f0f0f Apr 2, 2026
6bc2b66
correct usage of ThemingClassNames
0x0f0f0f Apr 2, 2026
bc78b13
adjust playonline
0x0f0f0f Apr 7, 2026
49a3605
adjust theming class names
0x0f0f0f Apr 7, 2026
9bf0899
adjust html snippet
0x0f0f0f Apr 7, 2026
58af87e
reintroduce the vite section in quickstart
0x0f0f0f Apr 7, 2026
8564deb
adjustments
0x0f0f0f Apr 7, 2026
77ea812
chore(getting-started): cleanup
moklick Apr 7, 2026
3875c25
adjust css of examples in learn section
0x0f0f0f Apr 7, 2026
69f4f67
remove theme
0x0f0f0f Apr 7, 2026
864f4cd
adjust example in dark mode
0x0f0f0f Apr 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/example-apps/react/learn/building-a-flow-2/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const initialNodes = [
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
type: 'output',
},
];

Expand Down
1 change: 1 addition & 0 deletions apps/example-apps/react/learn/building-a-flow-3/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ const initialNodes = [
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
type: 'output',
},
];
const initialEdges = [{ id: 'n1-n2', source: 'n1', target: 'n2' }];
Expand Down
3 changes: 2 additions & 1 deletion apps/example-apps/react/learn/building-a-flow-4/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ const initialNodes = [
id: 'n2',
data: { label: 'Node 2' },
position: { x: 100, y: 100 },
type: 'output',
},
];
const initialEdges = [
{ id: 'n1-n2', source: 'n1', target: 'n2', label: 'connects with', type: 'step' },
{ id: 'n1-n2', source: 'n1', target: 'n2', label: 'connects with', type: 'smoothstep' },
];

function Flow() {
Expand Down
28 changes: 0 additions & 28 deletions apps/example-apps/svelte/guides/custom-nodes/index.css

This file was deleted.

23 changes: 0 additions & 23 deletions apps/example-apps/svelte/guides/getting-started/b/App.svelte

This file was deleted.

25 changes: 0 additions & 25 deletions apps/example-apps/svelte/guides/getting-started/c/App.svelte

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<SvelteFlow bind:nodes bind:edges fitView colorMode="system">
<Background {variant} />
<Panel position="top-left">
<div>variant:</div>
<div style:color="var(--xy-node-color-default)">variant:</div>
<button
onclick={() => {
variant = BackgroundVariant.Dots;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
>
<Background patternColor="#aaa" gap={16} />
<Panel position="bottom-left">
<div style:font-family="monospace">
<div class="viewport-logger">
<div>x: {viewport.current.x.toFixed(2)}</div>
<div>y: {viewport.current.y.toFixed(2)}</div>
<div>zoom: {viewport.current.zoom.toFixed(2)}</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('./xy-theme.css');

html,
body {
margin: 0;
Expand Down Expand Up @@ -198,3 +196,10 @@ input[type='number']::-webkit-inner-spin-button {
.svelte-flow__minimap .annotation {
display: none;
}

.viewport-logger {
font-family: monospace;
color: var(--xy-node-color-default);
padding: 5px;
border-radius: 3px;
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
<script>
import { SvelteFlow, Background } from '@xyflow/svelte';
import { SvelteFlow, Background, Controls } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';
</script>

<div style:width="100vw" style:height="100vh">
<SvelteFlow colorMode="system">
<Background />
<Controls />
</SvelteFlow>
</div>
5 changes: 5 additions & 0 deletions apps/example-apps/svelte/learn/building-a-flow-1/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
html,
body {
margin: 0;
font-family: sans-serif;
}
26 changes: 26 additions & 0 deletions apps/example-apps/svelte/learn/building-a-flow-2/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script>
import { SvelteFlow, Background, Controls } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';

let nodes = $state.raw([
{
id: 'n1',
position: { x: 0, y: 0 },
data: { label: 'Node 1' },
type: 'input',
},
{
id: 'n2',
position: { x: 100, y: 100 },
data: { label: 'Node 2' },
type: 'output',
},
]);
</script>

<div style:width="100vw" style:height="100vh">
<SvelteFlow bind:nodes colorMode="system" fitView>
<Background />
<Controls />
</SvelteFlow>
</div>
5 changes: 5 additions & 0 deletions apps/example-apps/svelte/learn/building-a-flow-2/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
html,
body {
margin: 0;
font-family: sans-serif;
}
28 changes: 28 additions & 0 deletions apps/example-apps/svelte/learn/building-a-flow-3/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script>
import { SvelteFlow, Background, Controls } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';

let nodes = $state.raw([
{
id: 'n1',
position: { x: 0, y: 0 },
data: { label: 'Node 1' },
type: 'input',
},
{
id: 'n2',
position: { x: 100, y: 100 },
data: { label: 'Node 2' },
type: 'output',
},
]);

let edges = $state.raw([{ id: 'n1-n2', source: 'n1', target: 'n2' }]);
</script>

<div style:width="100vw" style:height="100vh">
<SvelteFlow bind:nodes bind:edges colorMode="system" fitView>
<Background />
<Controls />
</SvelteFlow>
</div>
5 changes: 5 additions & 0 deletions apps/example-apps/svelte/learn/building-a-flow-3/index.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
html,
body {
margin: 0;
font-family: sans-serif;
}
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
<script>
import { SvelteFlow, Background } from '@xyflow/svelte';
import { SvelteFlow, Background, Controls } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';

let nodes = $state.raw([
{
id: '1',
type: 'input',
id: 'n1',
position: { x: 0, y: 0 },
data: { label: 'Hello' },
data: { label: 'Node 1' },
type: 'input',
},
{
id: '2',
type: 'output',
id: 'n2',
position: { x: 100, y: 100 },
data: { label: 'World' },
data: { label: 'Node 2' },
type: 'output',
},
]);

let edges = $state.raw([
{ id: 'e1-2', source: '1', target: '2', type: 'smoothstep', label: 'to the' },
{ id: 'n1-n2', source: 'n1', target: 'n2', type: 'smoothstep', label: 'connects with' },
]);
</script>

<div style:width="100vw" style:height="100vh">
<SvelteFlow bind:nodes bind:edges fitView colorMode="system">
<Background />
<Controls />
</SvelteFlow>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ body {

/* This is just here to better match the design of svelteflow.dev */
.svelte-flow {
--xy-background-color: #f7f9fb;
--xy-edge-label-background-color-default: #f7f9fb;
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script>
import { SvelteFlow, Controls } from '@xyflow/svelte';
import { SvelteFlow, Controls, Background } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';

let nodes = $state.raw([
Expand Down Expand Up @@ -29,5 +29,6 @@
</script>

<SvelteFlow bind:nodes bind:edges fitView colorMode="system">
<Background />
<Controls />
</SvelteFlow>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ body,

/* This is just here to better match the design of svelteflow.dev */
.svelte-flow {
--xy-background-color: #f7f9fb;
--xy-edge-label-background-color-default: #f7f9fb;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ body,

/* This is just here to better match the design of svelteflow.dev */
.svelte-flow {
--xy-background-color: #f7f9fb;
--xy-edge-label-background-color-default: #f7f9fb;
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ body,

/* This is just here to better match the design of svelteflow.dev */
.svelte-flow {
--xy-background-color: #f7f9fb;
--xy-edge-label-background-color-default: #f7f9fb;
}
46 changes: 46 additions & 0 deletions apps/example-apps/svelte/learn/custom-node-2/App.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<script>
import { Background, SvelteFlow } from '@xyflow/svelte';
import '@xyflow/svelte/dist/style.css';

import TextUpdaterNode from './TextUpdaterNode.svelte';

const nodeTypes = {
textUpdater: TextUpdaterNode,
};

const rfStyle = {
backgroundColor: '#B8CEFF',
};

let nodes = $state.raw([
{
id: 'node-1',
type: 'textUpdater',
position: { x: 100, y: 0 },
data: { value: 123 },
},
{
id: 'node-2',
type: 'output',
targetPosition: 'top',
position: { x: 0, y: 200 },
data: { label: 'node 2' },
},
{
id: 'node-3',
type: 'output',
targetPosition: 'top',
position: { x: 200, y: 200 },
data: { label: 'node 3' },
},
]);

let edges = $state.raw([
{ id: 'edge-1', source: 'node-1', target: 'node-2', sourceHandle: 'a' },
{ id: 'edge-2', source: 'node-1', target: 'node-3', sourceHandle: 'b' },
]);
</script>

<SvelteFlow bind:nodes bind:edges {nodeTypes} fitView style={rfStyle} colorMode="system" >
<Background />
</SvelteFlow>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<script lang="ts">
import { Handle, Position, type NodeProps } from '@xyflow/svelte';

let { data }: NodeProps = $props();
</script>

<div class="text-updater-node">
<div>Custom Node</div>
<Handle type="target" position={Position.Top} />
<Handle type="source" position={Position.Bottom} id="a" style="left: 10px" />
<Handle type="source" position={Position.Bottom} id="b" />
</div>

<style>
.text-updater-node {
height: 50px;
border: 1px solid #eee;
padding: 5px;
border-radius: 5px;
background: var(--xy-node-background-color-default);
}

.text-updater-node label {
display: block;
color: var(--xy-node-color-default);
font-size: 12px;
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ body {
font-family: sans-serif;
}

.svelte-flow {
--xy-background-color: #f7f9fb;
#app {
width: 100vw;
height: 100vh;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading