Timeline
VTimeline lists dated events in order. Each VTimelineItem has a marker on the line, a date, a title and content of its own.
Usage
Order shipped
The parcel left our warehouse in Lyon.Payment confirmed
Paid by card ending in 4242.Order placed
Three items, delivered to Paris.
Examples
Dates in a column
layout="split" puts the dates in a column across the line, as wide as the longest date up to a third of the width. Below 30rem, the timeline falls back to stacked.
Order shipped
The parcel left our warehouse in Lyon.Payment confirmed
Paid by card ending in 4242.Order placed
Three items, delivered to Paris.
Alternating sides
layout="alternate" sends every other event across the line, its date facing it, and falls back to stacked below 36rem. A year or a month is written at that precision. Both side-by-side layouts take their width from their parent: in a flex row, give the timeline a basis of its own.
Project started
A handful of components for an internal tool.First public preview
Published on npm with twelve components.Version 1.0
A stable API, documented in English and French.Version 2.0
Design tokens, dark theme and nineteen new components.
Horizontal
orientation="horizontal" lays the events across, their markers, dates and titles in line. When they no longer fit, the list scrolls and is a tab stop so that a keyboard can scroll it.
Research
Design
Build
Beta
Launch
Markers
tone paints the marker and icon draws it in a round badge. The marker slot replaces it, with an avatar for instance. Markers are hidden from screen readers: say in the title what the tone means.
Deployed to production
Release 2.0.1 is live.Tests retried
Two browser tests passed on the second attempt.Build failed
Type error in the date input.Camille approved the changes
Commit pushed
Dates
timeText shows a relative date while the <time> keeps the exact one. locale and formatOptions change how days and moments are written. On a page rendered on a server, set timeZone in formatOptions for dates that carry an offset.
Camille commented
Sam approved
Alex opened it
Kick-off
Design review
Release
API
Props
| Prop | Type | Default |
|---|---|---|
orientation | TimelineOrientation'vertical' | 'horizontal' | 'vertical' |
| Whether the events run down the page or across it. | ||
layout | TimelineLayout'stacked' | 'split' | 'alternate' | 'stacked' |
| Where a vertical timeline puts the dates: above the titles, in a column across the line, or across from content on alternating sides. | ||
size | TimelineSize'sm' | 'md' | 'md' |
| Density of the spacing, markers and content text. | ||
headingLevel | TimelineHeadingLevel1 | 2 | 3 | 4 | 5 | 6 | none |
Renders the titles as h1 to h6. Without it, they are paragraphs. | ||
locale | string | none |
| Locale the dates are written in. Defaults to the design system locale. | ||
formatOptions | Intl.DateTimeFormatOptions | none |
Intl.DateTimeFormat options for days and moments. Years and months keep their format. | ||
| Prop | Type | Default |
|---|---|---|
datetime | string | none |
ISO year, month, day or moment, written out in the locale inside a <time>. | ||
timeText | string | none |
| Visible text replacing the written-out date. | ||
title | string | none |
What happened. Replaced by the title slot. | ||
tone | TimelineItemTone'neutral' | 'accent' | 'danger' | 'success' | 'warning' | 'accent' |
| Colour of the marker. | ||
icon | IconSource | none |
| Icon drawn in a round badge in place of the dot. | ||
Slots
| Slot | Type |
|---|---|
default | {} |
VTimelineItem children. | |
| Slot | Type |
|---|---|
default | {} |
| Details of the event. | |
title | {} |
| Title with markup. | |
marker | {} |
| Replaces the dot or the badge. It is decoration. | |
Types
Types used in the API tables. Import exported types from vectis-ui.
export interface BuiltinIcon {
name: string
paths: readonly [string] | readonly [string, string]
}export type IconRender =
| { path: string; viewBox?: string }
| { component: Component; props?: Record<string, unknown> }
| { src: string }
| { text: string; class?: string }
| { class: string }export type IconSource = string | BuiltinIcon | IconRender
CSS variables
| Token | Value |
|---|---|
--vectis-control-size-timeline-dot-sm | 0.5rem |
--vectis-control-size-timeline-dot-md | 0.625rem |
--vectis-control-size-timeline-icon-sm | 1.5rem |
--vectis-control-size-timeline-icon-md | 2rem |
--vectis-control-size-timeline-item-min | 12rem |