FlowEdge

An SVG edge with bezier/straight/smoothstep paths, an arrowhead, an optional label, and animation.

Category: display · WCAG 2.1-AA · flow, edge, connector, animated, svg

Variants

States

Props

PropTypeDefaultDescription
sourceXnumberSource anchor x (flow coords).
sourceYnumberY coordinate of the edge’s source point.
targetXnumberX coordinate of the edge’s target point.
targetYnumberY coordinate of the edge’s target point.
type'bezier' | 'straight' | 'smoothstep'bezierEdge path style ('bezier' | 'straight' | 'smoothstep').
animatedbooleanfalseWhen true, animates the edge path (dashed flow).
labelReactNodeText label for the control.
selectedbooleanfalseWhether the edge is rendered as selected.
markerStartbooleanfalseArrowhead at the source (points back toward the source) — set both for bidirectional.
markerEndbooleantrueArrowhead at the target. Set false for an undirected line.
classNamestringAdditional CSS class names merged onto the root element.
activeboolean | undefinedHighlight the edge (used by FlowStory's active step).
direction'forward' | 'reverse' | undefined'forward'Direction the dash travels when animated.
idstringEdge identifier, used to target it via `activeEdgeId`.
sourcePositionHandlePosition | undefined'right'Handle side the edge leaves from.
targetPositionHandlePosition | undefined'left'Handle side the edge arrives at.

Design tokens

When to use

When not to use

Examples

Edge path types

Bezier, straight, smoothstep, and an animated edge.

() => (
  <div style={{ position: 'relative', height: 220 }}>
    <FlowEdge sourceX={20} sourceY={30} targetX={260} targetY={30} type="bezier" label="bezier" />
    <FlowEdge sourceX={20} sourceY={90} targetX={260} targetY={90} type="smoothstep" label="step" />
    <FlowEdge sourceX={20} sourceY={150} targetX={260} targetY={150} animated label="animated" />
  </div>
)

Arrow direction

Forward (default), backward, bidirectional, or undirected — via markerStart/markerEnd.

() => (
  <div style={{ position: 'relative', height: 260 }}>
    <FlowEdge sourceX={20} sourceY={30} targetX={260} targetY={30} label="forward" />
    <FlowEdge sourceX={20} sourceY={90} targetX={260} targetY={90} markerEnd={false} markerStart label="backward" />
    <FlowEdge sourceX={20} sourceY={150} targetX={260} targetY={150} markerStart label="both" />
    <FlowEdge sourceX={20} sourceY={210} targetX={260} targetY={210} markerEnd={false} label="undirected" />
  </div>
)

Related components

← Back to docs