Vanilla Breeze

flow-diagram

User flow and sequence visualization — progressively enhances an ol into a connected node graph with actions, decisions, and branching paths.

Overview

A web component that progressively enhances an <ol> of steps into a connected node graph with typed shapes. Without JavaScript, the ordered list renders normally. With JavaScript, each step becomes a node with connectors, and decisions branch into parallel paths.

Node Types

TypeShapeColorUse Case
startPillGreenEntry point of the flow
actionRounded rectBlueUser or system action (default)
decisionRectAmberYes/no branch point
processRectPurpleBackground or automated process
waitDashed rectGrayDelay, timeout, or pause
endPillRedTerminal state

Attributes

AttributeTypeDefaultDescription
titlestringDiagram heading
srcstring (URL)JSON data URL
data-directionstring"vertical"vertical or horizontal
compactbooleanReduced spacing and node sizes

Step Attributes

Each <li> in the ordered list carries these data attributes:

AttributeOnDescription
data-type<li>Node type: start, action, decision, process, wait, end
data-annotation<li>Note text displayed below the node
data-branch<li>Branch label on decision children (e.g., "Yes", "No")

Decision Branching

To create branches from a decision node, nest an <ol> inside the decision <li>. Each branch is a <li data-branch="..."> containing its own <ol> of steps. Branches can contain further decisions for nested branching.

Events

EventDetailWhen
flow-diagram:ready{ nodeCount }After setup
flow-diagram:select{ type, text }Node clicked

Accessibility

  • The original <ol> stays in the DOM (hidden) for screen reader access
  • Each node has role="img" and descriptive aria-label
  • Nodes are focusable via tabindex="0"
  • Connectors are aria-hidden="true"
  • An aria-live="polite" region announces node selection

Related