FlowStory

A scripted, sequenced, looping flow animation — walks a graph step by step with fade-in captions.

Category: display · WCAG 2.1-AA · flow, animation, storyline, walkthrough, sequence

States

Props

PropTypeDefaultDescription
nodesFlowNode[]The nodes to render.
edgesFlowEdge[]The edges to render at each step.
scriptStoryStep[]Ordered steps: { from, to, label? } or { edge, reverse? }.
loopbooleantrueWhen true, navigation wraps around from end to start.
stepDurationnumber1500How long (ms) each step is shown during playback.
stepGapnumber0Extra pause after each step before advancing (ms) — makes the story easier to follow.
playingbooleanWhether the story is currently playing (controlled).
currentStepnumberThe controlled current step index.
onStepChange(step: number) => voidCalled with the new step index when it changes.
controlsbooleantrueWhether to show the controls.
autoPlaybooleantrueWhen true, starts playback automatically on mount.
interactivebooleanfalseA storyline is a view by default — set true to allow selecting/dragging/connecting.
classNamestringAdditional CSS class names merged onto the root element.

Design tokens

When to use

When not to use

Examples

A request/response storyboard

A<->B-->C: animate A→B, B→A, A→B, B→C, looping — each step fades in its caption.

() => (
  <FlowStory
    style={{ height: 340 }}
    nodes={[
      { id: 'A', position: { x: 0, y: 100 }, data: { label: 'Client' } },
      { id: 'B', position: { x: 240, y: 100 }, data: { label: 'Gateway' } },
      { id: 'C', position: { x: 480, y: 100 }, data: { label: 'Service' } },
    ]}
    edges={[
      { id: 'ab', source: 'A', target: 'B' },
      { id: 'bc', source: 'B', target: 'C' },
    ]}
    script={[
      { from: 'A', to: 'B', label: 'Request sent' },
      { from: 'B', to: 'A', label: 'Acknowledged' },
      { from: 'A', to: 'B', label: 'Payload streamed' },
      { from: 'B', to: 'C', label: 'Forwarded to Service' },
    ]}
    loop
  />
)

A linear pipeline

Each stage animates and is captioned in turn.

() => (
  <FlowStory
    style={{ height: 320 }}
    nodes={[
      { id: 'ingest', position: { x: 0, y: 100 }, data: { label: 'Ingest' } },
      { id: 'transform', position: { x: 240, y: 100 }, data: { label: 'Transform' } },
      { id: 'load', position: { x: 480, y: 100 }, data: { label: 'Load' } },
    ]}
    edges={[
      { id: 'it', source: 'ingest', target: 'transform' },
      { id: 'tl', source: 'transform', target: 'load' },
    ]}
    script={[
      { from: 'ingest', to: 'transform', label: 'Records ingested', description: 'Raw events read from the source' },
      { from: 'transform', to: 'load', label: 'Transformed', description: 'Cleaned and enriched' },
    ]}
  />
)

Related components

← Back to docs