PipelineGraph
Job dependency graph, left to right like the workflow view on GitHub Actions. nodes: { id, label, status, duration?, needs? }, where status is queued, running, success, failed, skipped or cancelled. The column is the longest path from a root; the first dependent of a node stays on its row and the others open new rows. An unknown id in needs is ignored and a cycle drops the dependency that closes it.
Click, select and pan. Nodes are buttons: onNodeClick(node) and selectedId (it sets aria-current). When the graph is larger than its container, drag (or touch-drag) to pan; a drag does not click a node, and tabbing to a node scrolls it into view. Give the container a size with className. Each node can carry a React label, a description, a custom icon, a trailing slot, its own className, an ariaLabel and disabled; renderNode(node, { selected, icon }) replaces the whole content, and nodeWidth, nodeHeight, gapX and gapY set the sizes.
Props
PipelineGraph
nodesPipelineNode[]Jobs;
statusis queued | running | success | failed | skipped | cancelled,needslists the ids a job waits for.label,duration,description,iconandtrailingtake any React node;classNamestyles one node,ariaLabelnames it when the label is not text,disabledmakes it unclickable. See the PipelineNode table below.onNodeClick(node) => voidCalled when a node is clicked (not after a drag).
selectedIdstring | nullId of the highlighted node (sets aria-current).
renderNode(node, { selected, icon }) => ReactNodeReplaces the content inside a node;
iconis the default status icon, to keep it.nodeWidthnumberDefault:176Node width in px.
nodeHeightnumberDefault:52Node height in px.
gapXnumberDefault:48Space between columns in px.
gapYnumberDefault:16Space between rows in px.
emptyTextReactNodeShown when there are no nodes (nothing is rendered by default).
aria-labelstringDefault:'Pipeline'Accessible name of the graph.
classNamestringDefault:''Extra classes for the root element.
| Prop | Type | Default | Description |
|---|---|---|---|
nodes | PipelineNode[] | – | Jobs; status is queued | running | success | failed | skipped | cancelled, needs lists the ids a job waits for. label, duration, description, icon and trailing take any React node; className styles one node, ariaLabel names it when the label is not text, disabled makes it unclickable. See the PipelineNode table below. |
onNodeClick | (node) => void | – | Called when a node is clicked (not after a drag). |
selectedId | string | null | – | Id of the highlighted node (sets aria-current). |
renderNode | (node, { selected, icon }) => ReactNode | – | Replaces the content inside a node; icon is the default status icon, to keep it. |
nodeWidth | number | 176 | Node width in px. |
nodeHeight | number | 52 | Node height in px. |
gapX | number | 48 | Space between columns in px. |
gapY | number | 16 | Space between rows in px. |
emptyText | ReactNode | – | Shown when there are no nodes (nothing is rendered by default). |
aria-label | string | 'Pipeline' | Accessible name of the graph. |
className | string | '' | Extra classes for the root element. |
PipelineNode
idstringUnique id of the job; other nodes name it in needs.
labelReactNodeName of the job.
status'queued' | 'running' | 'success' | 'failed' | 'skipped' | 'cancelled'Sets the icon, the border and the accessible name.
durationReactNodeShown under the label, e.g. '2m 25s'.
needsstring[]Ids of the nodes this one waits for. Unknown ids are ignored.
iconReactNodeReplaces the status icon (the status still sets the border and the accessible name).
descriptionReactNodeA second line under the label, above the duration.
trailingReactNodeContent at the right edge of the node, e.g. a badge or an avatar.
classNamestringExtra classes for this node's button, e.g. to recolor its border or background.
ariaLabelstringAccessible name; by default the label (when it is text, else the id), the status and the duration.
titlestringTooltip (default: the status).
disabledbooleanDefault:falseNot clickable, and skipped by the keyboard.
| Prop | Type | Default | Description |
|---|---|---|---|
id | string | – | Unique id of the job; other nodes name it in needs. |
label | ReactNode | – | Name of the job. |
status | 'queued' | 'running' | 'success' | 'failed' | 'skipped' | 'cancelled' | – | Sets the icon, the border and the accessible name. |
duration | ReactNode | – | Shown under the label, e.g. '2m 25s'. |
needs | string[] | – | Ids of the nodes this one waits for. Unknown ids are ignored. |
icon | ReactNode | – | Replaces the status icon (the status still sets the border and the accessible name). |
description | ReactNode | – | A second line under the label, above the duration. |
trailing | ReactNode | – | Content at the right edge of the node, e.g. a badge or an avatar. |
className | string | – | Extra classes for this node's button, e.g. to recolor its border or background. |
ariaLabel | string | – | Accessible name; by default the label (when it is text, else the id), the status and the duration. |
title | string | – | Tooltip (default: the status). |
disabled | boolean | false | Not clickable, and skipped by the keyboard. |