Timeline

Lists events in order along a line, such as the history of an order.

Order shipped
12 March 2025

We sent your order with FedEx. It should arrive in 3 to 5 working days.

Customs cleared
15 March 2025
Order delivered
17 March 2025, 10:30 am

Usage

Code
import { Timeline } from '@leverui/components';
Code
<Timeline.Root>
  <Timeline.Item>
    <Timeline.Connector>
      <Timeline.Separator />
      <Timeline.Indicator />
    </Timeline.Connector>
    <Timeline.Content>
      <Timeline.Title />
      <Timeline.Description />
    </Timeline.Content>
  </Timeline.Item>
</Timeline.Root>

Examples

Sizes

Use the size prop to change the size of the timeline.

W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed

Variants

Use the variant prop to change the variant of the timeline.

W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed
W
wren created a new project
wren changed status from In progress to Completed

Content Before

Here's an example of a timeline with content before the timeline indicator.

Nov 1994
1
The company opened a new office in the city centre.
Nov 2010
2
The company opened a new office in the city centre.
Nov 1994
1
The company opened a new office in the city centre.
Nov 2010
2
The company opened a new office in the city centre.
Nov 1994
1
The company opened a new office in the city centre.
Nov 2010
2
The company opened a new office in the city centre.

Alternating Content

Here's an example of a timeline with alternating content.

Order placed
Order prepared
Order delivered

Composition

Here's an example of how to compose the timeline with other components to create a consistent-looking timeline.

Theo Park changed 3 labels on Jan 1, 2024
Mara Ellison removed Corin on Jan 12, 2024
Iris commented on Jan 12, 2024
The new labels look good to me. I moved two cards to the review column and will check the others tomorrow.

Guides

Semantics

The root and the items are div elements. Default roles: list on the root, listitem on each item. Set role on either to replace it. The root's ref is an HTMLDivElement. Native attributes and events go to the part you set them on.

Content before the indicator

For a date or label beside the marker, put a Timeline.Content before Timeline.Connector and a second one after it for the event. To alternate sides, put a flexible content part on both sides of each connector and switch the side that holds the event from item to item. An Avatar.Root size="full" can fill an indicator. Interactive content, such as a button, can go inside Timeline.Content.

Responsive choices

size and variant are responsive, for example size={{ base: 'sm', md: 'lg' }}. showLastSeparator defaults to false: no line after the last item. Set it to true when the timeline carries on past the last event shown.

Reactive defaults

Timeline.RootPropsProvider sets default props for the roots inside it. Pass an object, or a function when the defaults depend on signals. A prop on a root wins. The part classes also work on plain HTML elements inside a Timeline root.

Props

Root

PropDefaultTypeDescription
colorPalettegraystringMarker color palette.
variantsolid'subtle' | 'solid' | 'outline' | 'plain'Marker style.
sizemd'sm' | 'md' | 'lg' | 'xl' or responsive mapTimeline size.
asdivNative HTML tagHTML tag to render.
asChild—Solid render functionRender your own element with the root's props.
unstyledfalsebooleanTurn off the Lever UI styles.
showLastSeparatorfalsebooleanShow the line after the last item.

Customize with CSS

Import @leverui/components/styles.css first.

  • .leverui-timeline__root
  • .leverui-timeline__item
  • .leverui-timeline__connector
  • .leverui-timeline__separator
  • .leverui-timeline__indicator
  • .leverui-timeline__content
  • .leverui-timeline__title
  • .leverui-timeline__description
Code
.leverui-timeline__title {
  letter-spacing: 0.01em;
}

The root has data-size, data-variant, and data-show-last-separator, plus one per screen size you set, such as data-size-md. class and style work on each part.

Set --leverui-timeline-indicator-size on the root to resize the markers. The connector line stays centered. Other variables: --leverui-timeline-indicator-bg, --leverui-timeline-indicator-color, --leverui-timeline-line-color, --leverui-timeline-line-width, --leverui-timeline-item-gap, --leverui-timeline-content-gap, --leverui-timeline-title-font-size.

Explorer

Click a part name in the sidebar to highlight it in the preview.

Component Anatomy

Hover to highlight, click to select parts