import { RevisionTimeline } from "@elabs-ai/components-ui";npm install @elabs-ai/components-tokens @elabs-ai/components-uiPaste it into Claude Code, Cursor, Codex or any other coding agent. Text in [brackets] is yours to fill in.
Add the brand-ui RevisionTimeline component (from @elabs-ai/components-ui) to this project. 1. Read https://elabs-ai.com/llms.txt first: it maps every package and the rules. If you can use MCP servers, connect https://elabs-ai.com/mcp and use its search, docs and tokens tools. If not, run the same lookups in the terminal: `npx -y @elabs-ai/components-cli search "<what you need>"` and `npx -y @elabs-ai/components-cli docs <Component>`. 2. Look RevisionTimeline up before writing code: `npx -y @elabs-ai/components-cli docs RevisionTimeline` prints its real props, variants, what it pairs with and what to avoid. 3. If @elabs-ai/components-ui is not installed yet: `pnpm add @elabs-ai/components-tokens @elabs-ai/components-ui` (or `npm install @elabs-ai/components-tokens @elabs-ai/components-ui`). If this is the first brand-ui package in the project, wire it once: import `@elabs-ai/components-tokens/styles.css` plus the `themes/light.css` and `themes/dark.css` stylesheets in the CSS entry, add one Tailwind `@source` line per installed @elabs-ai package (Tailwind does not scan node_modules, so without it everything renders unstyled), and wrap the app root in `ThemeProvider` from `@elabs-ai/components-tokens`. 4. Use it here: [the screen or file, and what it should show] 5. Rules: use only @elabs-ai/components-* components and the semantic tokens — no raw colours, no raw font sizes, no arbitrary Tailwind values. Look up each component's real props with the docs tool before you use it; never guess a prop. 6. Done means: the typecheck passes, `npx -y @elabs-ai/components-cli audit src --strict` reports nothing, and you have opened the app and looked at every screen you touched in the light and the dark theme.
Examples
Branch And Merge
Branch and merge — two lanes with a merge commit, showing SVG cross-lane bezier curves.
Selection
Selection — demonstrates controlled and uncontrolled selection with onSelect callback.
Compact
Compact density — tighter row height for dense information displays.
Controlled Selection
Controlled selection — parent manages the selected id externally.
Nested Branches
Collapsible branches — supply `branches` to fold a branch (and its nested descendants) into a single summary row at its tip. Click the chevron on the `feat/dark-mode` tip to collapse it; the nested `feat/dark-mode/tokens` commits fold in too, and the merge connector re-routes to the summary node.
Collapsed By Default
Collapsed by default — the branch starts folded; expanding restores its commits.
Controlled Collapse
Controlled collapse — the parent owns the collapsed-branch set.
Process Flow
Process flow — branches as collapsible, **deeply nested** categories. Opens fully folded into the top category ("Research phase · 8 steps"); each expand reveals that level's steps plus the next collapsed category, so you can drill four levels deep: Research phase ▸ Web search ▸ Fetch documents ▸ Rank results. A deliberate (useful) misuse of the branch model.
API
RevisionTimeline
| Prop | Type | Description |
|---|---|---|
revisionsrequired | Revision[] | Ordered revisions, newest → oldest. |
edges | RevisionEdge[] | Parent-link edges for drawing the branch graph. Each edge connects a child revision (`from`) to its parent (`to`). |
groupBy | "day" | "none" | How to group revisions. `"day"` inserts day headers; `"none"` renders a flat list. @default "day" |
formatDay | (d: Date) => string | Format the day-group header label. Defaults to `Intl.DateTimeFormat` long date. |
selectedId | string | Controlled selection: the id of the currently-selected revision. Omit to use uncontrolled selection (`defaultSelectedId`). |
defaultSelectedId | string | Initial selected revision id for uncontrolled usage. |
onSelect | (id: string) => void | Called when the user selects a revision row. |
branches | RevisionBranch[] | Collapsible branch registry. **Supplying this opts in to the collapse/expand mode.** Each listed branch becomes collapsible; a branch's commits fold into a single summary row at its tip. `parentBranchId` nests branches so collapsing a parent also folds its descendants (multi-level). A revision whose `branchId` is not listed here (e.g. the trunk) stays permanently visible. Omit entirely for the classic, non-collapsible timeline. |
collapsedBranchIds | string[] | Controlled set of collapsed branch ids. |
defaultCollapsedBranchIds | string[] | Uncontrolled initial set of collapsed branch ids. |
onBranchToggle | (branchId: string, collapsed: boolean) => void | Called when a branch is collapsed or expanded. `collapsed` is the NEXT state. |
formatBranchSummary | (count: number, branch: RevisionBranch) => string | Trailing summary text on a collapsed branch row. Defaults to `"<n> commit(s)"`; override to re-vocabulary the timeline (e.g. `"<n> steps"` when modelling a process flow rather than git history). |