Overview
A timeline is a vertical Stepper with small dots or icons, where each step is one event. It uses the Stepper markup, classes and script, so it has no class of its own. A Divider at the start of a step, or a Meta line under its title, gives the event its date. The script colors each event done, current or to come from the stepper’s data-current.
Pick another component when:
Markup
Variants
Each Structure is one use of the timeline, with its order and its labels written in. The Content card goes on every step’s content. Size applies to a timeline with icons, since a dot has one size.
| Group | Option | Markup | On element | Use |
|---|---|---|---|---|
| Structure | Shipment (default) (hint: Tracking with a place and a time per event) | — | — | Delivery or document tracking. A Meta line gives the place and the time of each event |
| Structure | Request (hint: A request’s history, newest on top) | canon #timeline-request |
— | The history of one request or case, with the decision pending and the permit to come. A divider dates each event |
| Structure | Activity (hint: A log of who did what, with an icon per kind of event) | canon #timeline-activity |
— | A log with nothing to come, such as the actions on a record. nds-static gives every event the same look, and nds-icons shows the kind of event. Each event’s Meta line gives who did it and when |
| Structure | Agenda (hint: Dated sessions with a Date Tile, first on top) (id: agenda) | canon #timeline-agenda |
— | A plan read from the start, such as an event program. nds-row on each step’s content puts a Date Tile beside the text, and nds-middle lines the text up on the tile’s middle. The tile follows the event’s state: a solid fill for the current event, gray for the events to come |
| Structure | Milestones (hint: The phases of a plan, with an icon each and a button on the current one) (id: milestones) | canon #timeline-milestones |
— | The phases of a project or a plan, first on top. nds-icons gives each phase its icon, and a done phase shows a check mark in its place. The current phase holds a button in nds-stepper-action |
| Order | Newest on top (default) (hint: The last event on top) (not: agenda, milestones) | .nds-reverse |
.nds-stepper |
The last event on top. Write the events oldest first, and add a new event at the end. See Order under Behavior |
| Order | Oldest on top (hint: The first event on top) (not: agenda, milestones) | — | — | The first event on top. Agenda and Milestones always read this way |
| Alternate | Alternate (hint: The line in the middle, the events on both sides. Desktop only) | .nds-alternate |
.nds-stepper:not(.nds-card) |
On a desktop, the line runs down the middle and the events take turns on each side of it. Tablets and phones keep every event on one side. For a page-wide history or plan, such as an About page. Not in a timeline card, which is too narrow |
| Size | MD (default) | — | — | 32px circles. A dot has one size: 16px |
| Size | LG | .nds-lg |
.nds-stepper:not(.nds-dot) |
40px circles. Not with dots |
| Size | XL | .nds-xl |
.nds-stepper:not(.nds-dot) |
48px circles. Not with dots |
| Card (any) | Timeline (hint: The whole timeline in one card. Turns on Stroke) (limit: 1 card) (demo: + stroke) | .nds-card |
.nds-stepper |
The whole timeline in one Card. For a timeline in a side column or a dashboard panel. Write Stroke too |
| Card (any) | Content (hint: Each event in a card beside its dot, with the line kept) (limit: 1 card) | .nds-card |
.nds-stepper-content |
The content of each event in a card beside its dot. The line stays, and the card border takes the color of the event’s state. Put the class on every step’s content. Add Stroke for the card’s own border color |
| Card (any) | Stroke (hint: A border in the card’s own color) (id: stroke) | .nds-stroke |
.nds-stepper.nds-card |
A border around the timeline card |
| Card (any) | Stroke (hint: A border in the card’s own color) (id: stroke) | .nds-stroke |
.nds-stepper-content.nds-card |
On every content card: the card’s own border color in place of the event’s state color |
| Card (any) | Shadow (hint: A shadow under each card) | .nds-shadow |
.nds-card |
An elevation shadow under each card. It combines with the border |
| On color | On color (hint: For a dark or brand background. Not with Meta) | .nds-oncolor |
.nds-stepper:not(:has(.nds-meta)) |
Light dots, lines and text, for a dark or brand background. Write nds-oncolor on every label divider too. Not with a Meta line, which has no on-color look. Inside an on-color area (data-theme="dark oncolor"), the timeline already takes this look: skip the class |
| On color | On color (hint: For a dark or brand background. Not with Meta) | .nds-oncolor |
.nds-stepper:not(:has(.nds-meta)) .nds-divider |
The same class on every label divider |
| Middle | Middle (default) (hint: The text on the middle of the Date Tile) | .nds-middle |
.nds-stepper-content.nds-row |
Lines the text up on the middle of the tile. Off, the text starts at the top of the tile. See Flex |
| Loading | Loading (hint: Skeleton placeholders while the data loads) | .nds-loading |
.nds-stepper |
Every event shows as a skeleton while its data loads. Keep steps in the markup for the skeleton to cover, and remove the class when the data is in |
Behavior
Order
nds-reverse shows the last step on top. Write the events oldest first, and add a new event at the end. Without it, the first step is on top: use that for a plan read from the start, such as an agenda.
Progress
data-current names the current event, from 1: the one in progress or the next to happen, such as a decision not yet made. The script marks the events before it done and the events after it to come. When nothing is left to come, write the number of events plus 1, and every event shows done.
Static
nds-static drops the progress, so every event has the same look. Use it for a log with nothing to come, such as the actions on a record. With nds-icons and no nds-dot, each event gets a circle with an icon for the kind of event.
Date Labels
A Divider at the start of a step’s content labels the event: a date, a quarter, or a word such as Today or Pending. Its line runs on as the separator between events. Give every event a label, or none: labels on only some events read unevenly.
Alternate
nds-alternate puts the line in the middle on a desktop, and the events take turns on each side of it, each one against the line. Tablets and phones keep every event on one side, since two columns would be too narrow. Use it for a page-wide history or plan, such as the milestones on an About page.
Built-in Features
-
Automatic State
Write
data-currentand the script marks every event done, current or to come. Write a new number later and the events change with it. -
Placeholders Before Start
Until the script starts, each event shows as a skeleton in its final layout.
-
New Events
Add a step and write the new count in
data-total, and the script reads the events again. -
Change Events
The timeline fires
nds:stepper:changeafterdata-currentordata-totalchanges.
Best Practices
- Write the events oldest first and add
nds-reversefor newest on top. A new event then goes at the end. - Write every date label in one format, such as
4 January 2026. - Keep a title to what happened, in 2 to 4 words. Put who, where and when in the description, or in a Meta line inside
nds-stepper-text, so it stays close to the title. - Say in the text when an event is still to come, such as “Pending”. A screen reader hears the current event, but not which events are completed or upcoming.
- Give the timeline an
idwhen a script changes it. The Stepper methods find it by its id. - Give a circle icon
aria-hidden="true". The title names the event. - Put a timeline that can grow long in a Scroll More, so the page keeps its length.
- Use
nds-dotornds-icons, not both. A dot shows no icon.
API
A timeline is a Stepper. Its methods, events, custom properties and tokens are on the Stepper page.
Classes
| Class | Element | Effect |
|---|---|---|
nds-vertical |
.nds-stepper |
The events in a column. A timeline needs it |
nds-dot |
.nds-stepper |
A small dot with no number for each event |
nds-reverse |
.nds-stepper |
The last step on top. See Order under Behavior |
nds-alternate |
.nds-stepper |
On a desktop, the line in the middle and the events on both sides. See Alternate under Behavior |
nds-static |
.nds-stepper |
Every event has the same look, with no progress. See Static under Behavior |
nds-row |
.nds-stepper-content |
The parts of the event side by side, such as a Date Tile beside the text |
nds-middle |
.nds-stepper-content.nds-row |
The parts on their middles, top to bottom. A Flex class |
nds-icons |
.nds-stepper |
A circle with an icon for each event, in place of the dot. Write one icon in every .nds-stepper-circle. Not with nds-dot |
Data Attributes
| Attribute | Element | Effect |
|---|---|---|
data-current |
.nds-stepper |
The current event, from 1: the one in progress or the next to happen. Write it at page load: without it, event 1 is current. The number of events plus 1 shows every event done. A static timeline ignores it |
data-total |
.nds-stepper |
The number of events. The script writes it when it starts. After you add or remove events, write the new count in it |
data-state |
.nds-stepper-step |
The script writes completed, current or upcoming on each event from data-current. Do not write it yourself |