component
Timeline
What happened to something, in order: a column of TimelineItems, each a dot on a line with what happened and when.
Paid
Client 1 paid by bank transfer.
Opened
Sent to Client 1
Defaultimport { Timeline } from 'rost/components/timeline/Timeline'
import { TimelineItem } from 'rost/components/timeline-item/TimelineItem'
<Timeline aria-label="Invoice history">
<TimelineItem current title="Paid" time="14 Nov, 09:12" dateTime="2026-11-14T09:12">
Client 1 paid by bank transfer.
</TimelineItem>
<TimelineItem title="Opened" time="12 Nov, 16:40" dateTime="2026-11-12T16:40" />
<TimelineItem title="Sent to Client 1" time="10 Nov, 11:05" dateTime="2026-11-10T11:05" />
</Timeline> src/components/timeline/Timeline.tsx
import { Children, cloneElement, isValidElement, type OlHTMLAttributes, type ReactElement, type ReactNode } from 'react'
import type { TimelineItemProps } from '../timeline-item/TimelineItem'
import './timeline.css'
export interface TimelineProps extends OlHTMLAttributes<HTMLOListElement> {
/** The TimelineItems, in order. */
readonly children: ReactNode
}
const b = 'rost-timeline'
/** What happened to something, in order. Built from contracts/timeline.contract.yaml. */
export function Timeline({ children, className, ...rest }: TimelineProps) {
const items = Children.toArray(children).filter(isValidElement) as ReactElement<TimelineItemProps>[]
return (
<ol className={[b, className].filter(Boolean).join(' ')} {...rest}>
{items.map((item, i) => (i === items.length - 1 ? cloneElement(item, { last: true }) : item))}
</ol>
)
}
The source for everything on this page: contracts/timeline.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: timeline
name: Timeline
kind: component
status: review
summary: "What happened to something, in order: a column of TimelineItems, each a dot on a line with what happened and when."
category: display
related: [ timeline-item, stepper, list-item ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "746:64"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=746-64
extractedAt: "2026-11-17"
extractedBy: hand
frozenAt: "2026-11-17"
props:
children: { type: slot, required: true, notes: "The TimelineItems, newest first or oldest first, but the same way every time." }
elements:
root:
notes: "An `<ol>`, so the events are counted. The items sit straight on top of each other: each one's line runs down to the next one's dot."
styles:
display: { value: flex, assert: false }
flex-direction: { value: column, assert: false }
margin: { token: spacing/gap/none, value: 0px }
padding: { token: spacing/gap/none, value: 0px }
list-style: { value: none, assert: false }
guidance:
status: proposed
use:
- title: The history of one thing
text: "An invoice that was drafted, sent, opened and paid. A vault that was set up and then shared."
avoid:
- title: Steps still to do
text: "A Timeline is what already happened. Steps someone has to go through are a **Stepper**."
- title: A feed
text: "Many unrelated things from many places. That's a list of **ListItems**."
behaviour: "It lays the items in a column and tells the last one it's last, so its line stops at its dot."
accessibility:
element: "`<ol>`, so a screen reader says how many events there are."
name: "Give it an `aria-label` when the heading above it doesn't say what it's the history of."
content: "Each item says what happened in a few words, past tense: Sent to Client 1, Paid."
Install
npx github:Runceanu/rost add timeline It lands in src/rost/timeline/, with what it needs and its contract. Install has the rest.
When to use
The history of one thing
An invoice that was drafted, sent, opened and paid. A vault that was set up and then shared.
When not to use
Steps still to do
A Timeline is what already happened. Steps someone has to go through are a Stepper.
A feed
Many unrelated things from many places. That's a list of ListItems.
Behaviour
It lays the items in a column and tells the last one it's last, so its line stops at its dot.
Accessibility
- Element
<ol>, so a screen reader says how many events there are. - Name
Give it an
aria-labelwhen the heading above it doesn't say what it's the history of.
Content
Each item says what happened in a few words, past tense: Sent to Client 1, Paid.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
children | slot | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
margin0pxspacing/gap/none -
padding0pxspacing/gap/none
displayflex · flex-directioncolumn · list-stylenone
Part of Timeline
TimelineItem
One event in a Timeline: a 12px dot, a line down to the next event, what happened, when, and a sentence if it needs one.
Sent to Client 1
Not current · Not lastSent to Client 1
Current · Not lastSent to Client 1
Not current · LastSent to Client 1
Current · Lastsrc/components/timeline-item/TimelineItem.tsx
import type { LiHTMLAttributes, ReactNode } from 'react'
import './timeline-item.css'
export interface TimelineItemProps extends Omit<LiHTMLAttributes<HTMLLIElement>, 'title'> {
/** The event that says where things stand now. Its dot is green. */
readonly current?: boolean
/** The bottom one. Timeline sets it. */
readonly last?: boolean
/** What happened, in a few words. */
readonly title: ReactNode
/** When. */
readonly time: ReactNode
/** Machine-readable form of `time`, for the `<time>` element. */
readonly dateTime?: string
/** A sentence more. */
readonly children?: ReactNode
}
const b = 'rost-timeline-item'
/** One event in a Timeline. Built from contracts/timeline-item.contract.yaml. */
export function TimelineItem({ current = false, last = false, title, time, dateTime, children, className, ...rest }: TimelineItemProps) {
return (
<li className={[b, current && `${b}--current`, last && `${b}--last`, className].filter(Boolean).join(' ')} aria-current={current ? 'step' : undefined} {...rest}>
<span className={`${b}__rail`} aria-hidden="true">
<span className={`${b}__dot`} />
<span className={`${b}__line`} />
</span>
<span className={`${b}__content`}>
<p className={`${b}__title`}>{title}</p>
<time className={`${b}__time`} dateTime={dateTime}>{time}</time>
{children != null && <p className={`${b}__body`}>{children}</p>}
</span>
</li>
)
}
The source for everything on this page: contracts/timeline-item.contract.yaml (opens in a new tab). The CSS, the docs and the checks in each app are built from it.
# yaml-language-server: $schema=../schema/component-contract.schema.json
schemaVersion: 2
id: timeline-item
name: TimelineItem
kind: component
status: review
partOf: timeline
summary: "One event in a Timeline: a 12px dot, a line down to the next event, what happened, when, and a sentence if it needs one."
category: display
related: [ timeline, step ]
source:
tool: figma
fileKey: 1Zy0wiWKXQAvsfDBX3KR0d
nodeId: "746:62"
url: https://www.figma.com/design/1Zy0wiWKXQAvsfDBX3KR0d/UI-Kit-v01?node-id=746-62
extractedAt: "2026-11-17"
extractedBy: hand
frozenAt: "2026-11-17"
props:
current: { type: boolean, default: false, notes: "The latest event, the state the thing is in now. Its dot is green." }
last: { type: boolean, default: false, notes: "The bottom one. Timeline sets it, so you don't have to." }
title: { type: slot, required: true, notes: "What happened, in a few words." }
time: { type: slot, required: true, notes: "When. A `<time>` with a `dateTime`, so it's machine-readable too." }
children: { type: slot, notes: "A sentence more, when the title isn't enough." }
elements:
root:
notes: "An `<li>`: the rail on the left, the words on the right, 12px apart."
styles:
display: { value: flex, assert: false }
gap: { token: spacing/gap/small-medium, value: 12px }
rail:
notes: "A 12px column for the dot and the line. 4px above the dot puts it in the middle of the title's line."
styles:
display: { value: flex, assert: false }
flex-direction: { value: column, assert: false }
align-items: { value: center }
flex-shrink: { value: "0", assert: false }
width: { token: spacing/size/3xsmall, value: 12px }
padding-top: { token: spacing/gap/2xsmall, value: 4px }
dot:
notes: "A 12px circle. Grey for what's past, green for where things are now."
styles:
display: { value: block, assert: false }
flex-shrink: { value: "0", assert: false }
width: { token: spacing/size/3xsmall, value: 12px }
height: { token: spacing/size/3xsmall, value: 12px }
border-radius: { token: spacing/radius/full, value: 10000px }
line:
notes: "A 1px line from 4px under the dot to the bottom of the item, where the next dot starts 4px further down."
styles:
display: { value: block, assert: false }
flex-grow: { value: "1", assert: false }
width: { token: spacing/outline/small, value: 1px }
margin-top: { token: spacing/gap/2xsmall, value: 4px }
background: { token: timeline-item/line, value: "#3a3a3a" }
content:
notes: "The title, the time and the sentence in a column, 2px apart, with 24px under them before the next event."
styles:
display: { value: flex, assert: false }
flex-direction: { value: column, assert: false }
gap: { token: spacing/gap/3xsmall, value: 2px }
min-width: { value: "0", assert: false }
padding-bottom: { token: spacing/gap/large, value: 24px }
title:
notes: "Paragraph type, medium weight, the main text colour."
styles:
margin: { token: spacing/gap/none, value: 0px }
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-weight: { token: typography/paragraph/font-weight/medium, value: "500" }
font-size: { token: typography/paragraph/font-size, value: 14px }
line-height: { token: typography/paragraph/line-height, value: 20px }
letter-spacing: { token: typography/paragraph/letter-spacing, value: 0px }
color: { token: timeline-item/title, value: "#ededed" }
time:
notes: "Label type in the tertiary grey."
styles:
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-weight: { token: typography/label/font-weight/regular, value: "400" }
font-size: { token: typography/label/font-size, value: 12px }
line-height: { token: typography/label/line-height, value: 14px }
letter-spacing: { token: typography/label/letter-spacing, value: 0px }
color: { token: timeline-item/time, value: "#999999" }
body:
optional: true
notes: "Paragraph type, a step quieter than the title."
styles:
margin: { token: spacing/gap/none, value: 0px }
font-family: { token: font-family/base, value: "'General Sans Variable'" }
font-weight: { token: typography/paragraph/font-weight/regular, value: "400" }
font-size: { token: typography/paragraph/font-size, value: 14px }
line-height: { token: typography/paragraph/line-height, value: 20px }
letter-spacing: { token: typography/paragraph/letter-spacing, value: 0px }
color: { token: timeline-item/body, value: "#d3d9d5" }
variants:
- when: { current: false, last: false }
figmaNode: "746:30"
elements:
dot:
background: { token: timeline-item/past/dot, value: "#747573" }
- when: { current: true, last: false }
figmaNode: "746:38"
elements:
dot:
background: { token: timeline-item/current/dot, value: "#00d669" }
- when: { current: false, last: true }
figmaNode: "746:46"
elements:
dot:
background: { token: timeline-item/past/dot, value: "#747573" }
line:
display: { value: none, assert: false, notes: "Nothing comes after the last one." }
content:
padding-bottom: { token: spacing/gap/none, value: 0px }
- when: { current: true, last: true }
figmaNode: "746:54"
elements:
dot:
background: { token: timeline-item/current/dot, value: "#00d669" }
line:
display: { value: none, assert: false, notes: "Nothing comes after the last one." }
content:
padding-bottom: { token: spacing/gap/none, value: 0px }
guidance:
status: proposed
use:
- title: Now in green
text: "Mark the event that says where things stand now as current. Only one, and usually the newest."
show: "current=True, last=False"
avoid:
- title: Colour as the only signal
text: "The green dot means now, but the title has to say what happened. Nobody should need the colour to read it."
behaviour: "The dot and line are drawing. The title, the time and the sentence are the content."
accessibility:
element: "`<li>`, with the time in a `<time>` element. The current one has `aria-current=\"step\"`. The dot and line are hidden from screen readers."
colour: "The past dot is 4.3:1 on the dark page, the current one 10:1. The title is 17:1, the time 7:1."
Install
npx github:Runceanu/rost add timeline-item It lands in src/rost/timeline-item/, with what it needs and its contract. Install has the rest.
When to use
Now in green
Mark the event that says where things stand now as current. Only one, and usually the newest.
When not to use
Colour as the only signal
The green dot means now, but the title has to say what happened. Nobody should need the colour to read it.
Behaviour
The dot and line are drawing. The title, the time and the sentence are the content.
Accessibility
- Element
<li>, with the time in a<time>element. The current one hasaria-current="step". The dot and line are hidden from screen readers. - Colour
The past dot is 4.3:1 on the dark page, the current one 10:1. The title is 17:1, the time 7:1.
Props
| Prop | Type | Values | Default |
|---|---|---|---|
current | boolean | | false |
last | boolean | | false |
title | slot | | |
time | slot | | |
children | slot | | |
Values
Straight from the contract. Each value sits next to its token, because six tokens here all come out as #3a3a3a and the colour alone can't tell you which one is right.
Never changes
root
-
gap12pxspacing/gap/small-medium
displayflex
rail
-
width12pxspacing/size/3xsmall -
padding-top4pxspacing/gap/2xsmall
displayflex · flex-directioncolumn · align-itemscenter · flex-shrink0
dot
-
width12pxspacing/size/3xsmall -
height12pxspacing/size/3xsmall -
border-radius10000pxspacing/radius/full
displayblock · flex-shrink0
line
-
width1pxspacing/outline/small -
margin-top4pxspacing/gap/2xsmall -
background#3a3a3atimeline-item/line
displayblock · flex-grow1
content
-
gap2pxspacing/gap/3xsmall -
padding-bottom24pxspacing/gap/large
displayflex · flex-directioncolumn · min-width0
title
-
margin0pxspacing/gap/none -
font-family'General Sans Variable'font-family/base -
font-weight500typography/paragraph/font-weight/medium -
font-size14pxtypography/paragraph/font-size -
line-height20pxtypography/paragraph/line-height -
letter-spacing0pxtypography/paragraph/letter-spacing -
color#edededtimeline-item/title
time
-
font-family'General Sans Variable'font-family/base -
font-weight400typography/label/font-weight/regular -
font-size12pxtypography/label/font-size -
line-height14pxtypography/label/line-height -
letter-spacing0pxtypography/label/letter-spacing -
color#999999timeline-item/time
body
-
margin0pxspacing/gap/none -
font-family'General Sans Variable'font-family/base -
font-weight400typography/paragraph/font-weight/regular -
font-size14pxtypography/paragraph/font-size -
line-height20pxtypography/paragraph/line-height -
letter-spacing0pxtypography/paragraph/letter-spacing -
color#d3d9d5timeline-item/body
Changes by variant
4 variants. Each table is what one thing changes with: a column per current, a row per property. Where every row starts with the same token path, it's written once, under the property.
Follows current
| Property | Not current | Current |
|---|---|---|
dot.backgroundtimeline-item/… | past/dot #747573 | current/dot #00d669 |
Only in some variants
These don't change: they're just set in some variants and not others.
Last
-
content.padding-bottom0pxspacing/gap/none -
line.displaynonelayout