Neura UI

Loading…

 Logo

Flow

Native left-to-right workflow canvas — pan, zoom, multi-output nodes, drag-to-connect edges, snap grid, toolbar and minimap. Zero third-party graph libraries.

Basic Usage

Pass nodes and edges . Positions are optional — missing ones are auto-laid out left to right. Hover a node to light its pipeline — everything it is fed by and feeds — and dim the rest (:trace="false" turns it off).
blade
Empty flow Add nodes to start building your workflow.
Drag nodes · scroll to zoom · drag background to pan · drag a + / right port onto another node to connect · Delete to remove
<neura::flow :nodes="$nodes" :edges="$edges" height="380px" />

Branching workflow

Multiple outputs via data.outputs . Edges use sourceHandle to pick a port.
javascript
Empty flow Add nodes to start building your workflow.
$nodes = [
    ['id' => 'w2', 'data' => [
        'label' => 'Review',
        'outputs' => [
            ['id' => 'ok', 'label' => 'Approve'],
            ['id' => 'ko', 'label' => 'Reject'],
        ],
    ]],
];
$edges = [
    ['source' => 'w2', 'target' => 'w3', 'sourceHandle' => 'ok', 'animated' => true],
    ['source' => 'w2', 'target' => 'w4', 'sourceHandle' => 'ko'],
];

<neura::flow :nodes="$nodes" :edges="$edges" height="420px" />

Node shapes

Steps are horizontal cards by default. shape="node" turns them into n8n-style square tiles with their name below; then a trigger is rounded on its left and has no input, an agent is a wide tile with sub-connectors underneath, a sub node plugs into one from below, and a note is a sticky note on the canvas. Set a node's own shape with its type or data.shape . Among cards, a trigger stays a card, marked with a bolt. Icons are kit icon names, glyphs, or an image URL for a logo.
blade
Empty flow Add nodes to start building your workflow.
Hover a node for its actions · drag a sub-node’s top diamond onto the agent · hover a connection to insert a step or delete it · double-click a node to open it
<neura::flow shape="node" :nodes="$nodes" :edges="$edges" />

Card styles

variant sets the style of every node — elevated , outline , soft (tinted with the node’s colour) or solid — and data.variant one node’s. Colours are design-system names (violet , success-600 ) or any CSS colour.
javascript
Empty flow Add nodes to start building your workflow.
<neura::flow :nodes="$nodes" :edges="$edges" variant="soft" />

// One node
['id' => 'mail', 'data' => ['label' => 'Send email', 'icon' => 'envelope', 'color' => 'violet', 'variant' => 'solid']]

// config/neura-kit.php
'flow' => Config::flow([
    'default' => ['shape' => 'node', 'variant' => 'soft'],
]),

Execution states

data.status marks a run: success , error , running or waiting ; data.disabled greys a step out. A connection takes a status too, and a label such as the number of items it carried.
javascript
Empty flow Add nodes to start building your workflow.
['id' => 'http', 'data' => ['label' => 'HTTP Request', 'icon' => 'globe-alt', 'status' => 'success']]
['id' => 'slack', 'data' => ['label' => 'Notify Slack', 'status' => 'error']]
['id' => 'archive', 'data' => ['label' => 'Archive', 'disabled' => true]]

['source' => 'http', 'target' => 'if', 'status' => 'success', 'label' => '12 items']

Themes

theme sets the look of the whole flow. classic draws square tiles with their name below and curved connections. signal draws capsules with a status light, circuit-like traces, and data dots moving along the connections that run (animated or status: running ). The same nodes and edges work in both.
javascript
Empty flow Add nodes to start building your workflow.
<neura::flow theme="signal" :nodes="$nodes" :edges="$edges" />

// An agent's steps, as chips
['id' => 'agent', 'type' => 'agent', 'data' => ['label' => 'AI Agent', 'status' => 'running', 'steps' => ['plan', 'calendar', 'reply']]]

// Data dots on a running connection
['source' => 'orders', 'target' => 'agent', 'animated' => true, 'label' => '12']

// config/neura-kit.php
'flow' => Config::flow([
    'default' => ['theme' => 'signal'],
]),

Pipelines and relations

A table node lists its rows — columns, fields — and every row has its own connectors, so a pipeline links row to row: a foreign key to its primary key, a column to the column it feeds. Edges name rows in sourceHandle and targetHandle . Hover a row to light its lineage through the whole pipeline, upstream and downstream; the rest dims.
blade
Empty flow Add nodes to start building your workflow.
Empty flow Add nodes to start building your workflow.
Hover revenue in revenue_by_country to see where it comes from · drag a row’s right connector onto another row to link them
<neura::flow :nodes="$nodes" :edges="$edges" />
<neura::flow theme="signal" :nodes="$nodes" :edges="$edges" />

Empty canvas

blade
Empty flow Add nodes to start building your workflow.
<neura::flow :nodes="[]" :edges="[]" height="280px" :showMinimap="false" />

Snap, minimap & edges

Tune interaction and chrome with props:
Blade
<neura::flow
    :nodes="$nodes"
    :edges="$edges"
    height="500px"
    :snapToGrid="true"
    :gridSize="16"
    :showMinimap="true"
    :showToolbar="true"
    edgeType="smoothstep"
    :defaultEdgeAnimated="false"
    backgroundClasses="grid"
    toolbarClasses="bottom left"
    :minZoom="0.2"
    :maxZoom="2.5"
    :zoomOnWheelScroll="true"
    :panOnDrag="true"
    :nodesConnectable="true"
    :fitViewOnInit="true"
/>

Data structure

JavaScript
// Node
[
    'id' => 'unique-id',
    'type' => 'step',
    'position' => ['x' => 120, 'y' => 80], // optional
    'data' => [
        'label' => 'Title',
        'description' => 'Subtitle',
        'icon' => 'envelope',   // kit icon name, or a glyph such as ▶
        'image' => null,        // logo URL, instead of the icon
        'color' => 'violet',    // design-system name or any CSS colour
        'shape' => 'card',      // card | node | trigger | agent | sub | note | table (default: from the type, else the flow's)
        'variant' => 'soft',    // elevated | outline | soft | solid
        'status' => 'running',  // success | error | running | waiting
        'disabled' => false,    // greyed out, name struck through
        'text' => null,         // a note's body
        'inputs' => null,       // an agent's sub-connectors (default: model, memory, tool)
        'steps' => null,        // an agent's steps, shown as chips: ['plan', 'reply']
        'rows' => null,         // a table's rows: names, or ['id' => 'total', 'type' => 'numeric', 'key' => 'pk|fk']
        'outputs' => [         // multi-output ports (right)
            ['id' => 'success', 'label' => 'Success'],
            ['id' => 'error', 'label' => 'Error'],
        ],
    ],
]

// Edge
[
    'id' => 'e1',              // optional
    'source' => 'node-a',
    'target' => 'node-b',
    'sourceHandle' => 'success', // default: out
    'targetHandle' => 'in',      // default: in
    'type' => 'bezier',          // or smoothstep
    'animated' => true,
    'label' => '3 items',        // pill in the middle
    'status' => 'success',       // success | error | running
    'sourceOffset' => -12,       // shift attachment up/down (px)
    'targetOffset' => 18,
]

// Self-loop (same node)
['source' => 'node-a', 'target' => 'node-a']
Select an edge → drag an endpoint up/down along the node to reposition (live). Drag onto another node to reconnect. Or call flow.updateEdge(id, { target: '3', targetOffset: 20 }) .

Props

Prop Type Default Description
nodesarray[]Initial nodes
edgesarray[]Connections
heightstring500pxCanvas height
directionstringlrFlow direction (left → right)
edgeTypestringtheme'sbezier | smoothstep; by default bezier in classic, smoothstep in signal (loops always use an orthogonal U-turn)
defaultEdgeAnimatedbooleanfalseAnimate edges created by drag-connect / addEdge
snapToGridbooleantrueSnap node drag to grid
gridSizenumber16Snap grid size
showMinimapbooleantrueOverview map
showToolbarbooleantrueZoom / fit / delete controls
backgroundClassesstringdotsdots | grid | none
minZoom / maxZoomnumber0.25 / 2.5Zoom limits
zoomOnWheelScrollbooleantrueWheel zooms toward cursor
panOnDragbooleantrueDrag empty canvas to pan
nodesDraggablebooleantrueAllow moving nodes
nodesConnectablebooleantrueAllow drawing edges
themestringconfig: classicLook of the flow: classic | signal (pack: Flow\Theme)
shapestringconfig: cardShape of nodes that name none: card | node | trigger | agent | sub | note | table (pack: Flow\Shape); signal draws capsules (node) unless set
variantstringconfig: elevatedCard style: elevated | outline | soft | solid (pack: Flow\Variant)
iconsarray[]Extra icon names, for nodes added later
tracebooleantrueHovering a node (or a table row) lights its pipeline and dims the rest
nodeActionsbooleantrueRun, deactivate and delete buttons over a hovered node
fitViewOnInitbooleantrueFit graph on load (alias: autoCenter)

Events

Events bubble from the flow root. Listen with Alpine / Livewire:
Event Detail
flow-initnodes, edges, viewport
flow-changeFull toObject() snapshot
flow-connectNew edge
flow-edge-updateEdge reconnected / repositioned
flow-node-selectSelected node ids
flow-nodes-deletedDeleted ids
flow-node-runnode — the run button of a hovered node
flow-node-togglenode, disabled — the node was deactivated or activated
flow-node-opennode — a double-click, to open its settings
flow-edge-insertedge, position — the + of a hovered connection, to insert a step
Blade
<div @flow-change="console.log($event.detail)">
    <neura::flow :nodes="$nodes" :edges="$edges" />
</div>

API

Alpine component: neuraFlow (alias flowEditor ).
Blade
<div x-data="{ flow: null }">
    <div
        x-data="neuraFlow({ nodes: [], edges: [] })"
        x-init="flow = $data"
        style="height: 420px"
        class="flow"
    ></div>

    <button @click="flow.addNode({ data: { label: 'New step' } })">Add</button>
    <button @click="flow.addEdge({ source: '1', target: '2', animated: true })">Connect (animated)</button>
    <button @click="flow.fitView()">Fit</button>
    <button @click="console.log(flow.toObject())">Export</button>
</div>
Methods: addNode , removeNodes , addEdge , updateEdge , removeEdges , fitView , setViewport , zoomIn , zoomOut , toObject , getNode , selectNodes , deleteSelection .