Skip to main content
Login

Sign in to access your account

Timeline - National Design System

A timeline lists dated events in order, such as the history of a request, with the events done, the current one and the ones to come.

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:

  • the user moves through the steps of a flow, such as a form: Stepper
  • the dated items have no order between them, such as a list of exam dates: Drawer rows with a Date Tile
  • the progress is a percentage: Progress

Markup

Options
Structure
Order
Size
Card
More
Preview
Document issued Riyadh 12 March, 9:20 AM
Handed to the courier Riyadh 12 March, 2:05 PM
At the sorting center Jeddah 13 March, 7:40 AM
Out for delivery Jeddah 13 March, 10:15 AM
Delivered Expected today by 6:00 PM
<div class="nds-stepper nds-vertical nds-dot nds-reverse" id="shipment-timeline" data-current="4"> <div class="nds-stepper-step"> <div class="nds-stepper-base"> <div class="nds-stepper-circle"></div> </div> <div class="nds-stepper-content"> <div class="nds-stepper-text"> <span class="nds-stepper-title">Document issued</span> <span class="nds-meta"> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-location-01" aria-hidden="true"></i> Riyadh </span> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-clock-01" aria-hidden="true"></i> 12 March, 9:20 AM </span> </span> </div> </div> </div> <div class="nds-stepper-step"> <div class="nds-stepper-base"> <div class="nds-stepper-circle"></div> </div> <div class="nds-stepper-content"> <div class="nds-stepper-text"> <span class="nds-stepper-title">Handed to the courier</span> <span class="nds-meta"> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-location-01" aria-hidden="true"></i> Riyadh </span> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-clock-01" aria-hidden="true"></i> 12 March, 2:05 PM </span> </span> </div> </div> </div> <div class="nds-stepper-step"> <div class="nds-stepper-base"> <div class="nds-stepper-circle"></div> </div> <div class="nds-stepper-content"> <div class="nds-stepper-text"> <span class="nds-stepper-title">At the sorting center</span> <span class="nds-meta"> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-location-01" aria-hidden="true"></i> Jeddah </span> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-clock-01" aria-hidden="true"></i> 13 March, 7:40 AM </span> </span> </div> </div> </div> <div class="nds-stepper-step"> <div class="nds-stepper-base"> <div class="nds-stepper-circle"></div> </div> <div class="nds-stepper-content"> <div class="nds-stepper-text"> <span class="nds-stepper-title">Out for delivery</span> <span class="nds-meta"> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-location-01" aria-hidden="true"></i> Jeddah </span> <span class="nds-meta-item"> <i class="hgi hgi-stroke hgi-clock-01" aria-hidden="true"></i> 13 March, 10:15 AM </span> </span> </div> </div> </div> <div class="nds-stepper-step"> <div class="nds-stepper-base"> <div class="nds-stepper-circle"></div> </div> <div class="nds-stepper-content"> <div class="nds-stepper-text"> <span class="nds-stepper-title">Delivered</span> <span class="nds-stepper-description">Expected today by 6:00 PM</span> </div> </div> </div> </div>

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-current and 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:change after data-current or data-total changes.

Best Practices

  • Write the events oldest first and add nds-reverse for 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 id when 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-dot or nds-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
Last Modified Date: 20/11/2026 - 04:53 PM
Was this page useful?
60% of users said Yes from 2843 Feedbacks