Skip to Content
You are viewing the v1 docs of Svelte Flow. You can find the latest version here.
ExamplesStyling

Tailwind CSS

In this example we are using Tailwind  for styling the flow.

Import the Svelte Flow stylesheet into the base layer so that Tailwind can override the default styles.

index.css
@import '@xyflow/svelte/dist/style.css' layer(base); @import 'tailwindcss';
import type { Node, Edge } from '@xyflow/svelte'; export const initialNodes: Node[] = [ { id: '1', type: 'custom', data: { name: 'Jane Doe', job: 'CEO', emoji: '😎' }, position: { x: 0, y: 50 }, }, { id: '2', type: 'custom', data: { name: 'Tyler Weary', job: 'Designer', emoji: '🤓' }, position: { x: -200, y: 200 }, }, { id: '3', type: 'custom', data: { name: 'Kristi Price', job: 'Developer', emoji: '🤩' }, position: { x: 200, y: 200 }, }, ]; export const initialEdges: Edge[] = [ { id: 'e1-2', source: '1', target: '2', }, { id: 'e1-3', source: '1', target: '3', }, ];
Last updated on