FlowNode

An HTML node box positioned in the viewport pane — draggable, selectable, with arbitrary children.

Category: display · WCAG 2.1-AA · flow, node, draggable, graph

States

Props

PropTypeDefaultDescription
idstringStable node id.
position{ x: number; y: number }Position in flow coords (controllable).
defaultPositionXYPositionInitial position for an uncontrolled node — the node then owns its own position as it is dragged. Pass `position` instead to control it.
onPositionChange(position: XYPosition) => voidFired while dragging.
zoomnumber1Current zoom (drag deltas are divided by it).
selectedbooleanfalseWhether the node is rendered as selected.
draggablebooleantrueWhether the node can be dragged.
interactivebooleantrueWhen false, the node is view-only: not draggable, selectable, or focusable.
onSelect(id: string) => voidCalled with the selected value.
childrenReactNodeAny cascivo content.
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

Examples

A draggable node

() => (
  <div style={{ position: 'relative', height: 160 }}>
    <FlowNode id="a" defaultPosition={{ x: 40, y: 50 }}>Service A</FlowNode>
  </div>
)

Related components

← Back to docs