Timeline
A vertical list of events with times, joined by a rule.
SourceStyles source@monoline/react 0.5.0Markdown for AI toolsstable
- Built on native elements
- 2 parts, named exports
- An ordered list of events; the time is a real time element when a datetime is given.
- Styles in one file:
timeline.css
Import
import '@monoline/css';
import {Timeline} from '@monoline/react';
Not installed yet? Pick a route.
Copies the source and its styles into your project.
npx monoline add timeline
Usage
import {Timeline, TimelineItem} from '@monoline/react';
<Timeline aria-label="Activity">
<TimelineItem title="Project created" time="3 days ago" dateTime="2026-11-09">Ada started the project.</TimelineItem>
<TimelineItem title="First release" time="Yesterday" dateTime="2026-11-11" />
<TimelineItem title="Public" time="Today" dateTime="2026-11-12" />
</Timeline>
Anatomy
Import the parts you need and nest them like this.
import {Timeline, TimelineItem} from '@monoline/react';
<Timeline>
<TimelineItem />
</Timeline>
Examples
Activity
Props
TimelineItemProps
| Prop | Type | Default | Description |
|---|---|---|---|
title required | ReactNode | – | What happened, shown as the entry's heading line. |
time | ReactNode | – | Human text for when it happened, such as "2 days ago". |
dateTime | string | – | Machine-readable date for the time element. |
Data Attributes
State is exposed through attributes. Style it with these selectors, not with class toggles.
This component sets no state attributes.
CSS classes
| Class | Stylesheet |
|---|---|
.timeline | timeline.css |
.timeline-body | timeline.css |
.timeline-item | timeline.css |
.timeline-time | timeline.css |
.timeline-title | timeline.css |
Customization
Style it with the kit's tokens in your own CSS, loaded after @monoline/css. Prefer the attributes above over extra classes. See Theming for every token.
app.css
.timeline {
border-color: var(--accent);
}
Accessibility
- An ordered list of events; the time is a real time element when a datetime is given.