Feedback
Timeline
A vertical list of dated events — order tracking, audit logs, incident history and activity feeds.
import { Timeline } from '@reactloom/ui';Examples
Order tracking
Tone colours the marker; statusLabel says the same in text.
- Order placedDone
- PackedDoneTwo boxes, 3.2 kg
- Courier delayedDelayedWeather at the hub. New estimate: Friday.
- DeliveryExpected Friday
import { Timeline, type TimelineItem } from '@reactloom/ui';
const at = (day: number, hour: number) => new Date(Date.UTC(2031, 2, day, hour));
const items: TimelineItem[] = [
{ id: 'placed', title: 'Order placed', time: at(3, 9), tone: 'success', statusLabel: 'Done' },
{ id: 'packed', title: 'Packed', time: at(4, 14), tone: 'success', statusLabel: 'Done', description: 'Two boxes, 3.2 kg' },
{ id: 'delay', title: 'Courier delayed', time: at(5, 8), tone: 'warning', statusLabel: 'Delayed', description: 'Weather at the hub. New estimate: Friday.' },
{ id: 'delivery', title: 'Delivery', time: 'Expected Friday' },
];
const format = (d: Date) => new Intl.DateTimeFormat('en-GB', { dateStyle: 'medium', timeStyle: 'short', timeZone: 'UTC' }).format(d);
export default function Example() {
return <Timeline aria-label="Order history" items={items} formatTime={format} />;
}Audit log with icons
- Ada changed the plan to Business
- Sign-in from a new deviceInfoChrome on Windows, Lisbon
- API key revokedSecurity
import { Avatar, Timeline } from '@reactloom/ui';
const at = (hour: number, minute: number) => new Date(Date.UTC(2031, 2, 12, hour, minute));
const format = (d: Date) => new Intl.DateTimeFormat('en-GB', { timeStyle: 'short', timeZone: 'UTC' }).format(d);
export default function Example() {
return (
<Timeline
aria-label="Audit log"
density="sm"
formatTime={format}
items={[
{ id: '1', title: 'Ada changed the plan to Business', time: at(9, 12), icon: <Avatar name="Ada Lovelace" size="xs" /> },
{ id: '2', title: 'Sign-in from a new device', time: at(10, 3), tone: 'info', statusLabel: 'Info', description: 'Chrome on Windows, Lisbon' },
{ id: '3', title: 'API key revoked', time: at(11, 47), tone: 'danger', statusLabel: 'Security' },
]}
/>
);
}API reference
| Prop | Type | Default |
|---|---|---|
itemsrequired{ id, title, time?, description?, tone?, statusLabel?, icon? } | readonly TimelineItem[] | — |
formatTimeFormats Date values. | (date: Date) => string | locale medium date, short time |
density | 'sm' | 'md' | 'md' |
Customization
Extracted from the component’s source on every build, so it matches the code. How the layers fit together is explained in Customization.
State attributes
Target these in your CSS to style states without depending on class names.
| Attribute | Values |
|---|---|
[data-density] | sm · md |
[data-tone] | present when on |
Theme tokens it reads
--pl-color-bg-surface --pl-color-border-default --pl-color-border-strong --pl-color-danger-fg --pl-color-danger-solid --pl-color-fg-default --pl-color-fg-muted --pl-color-info-fg --pl-color-info-solid --pl-color-success-fg --pl-color-success-solid --pl-color-warning-fg --pl-color-warning-solid --pl-font-size-sm --pl-font-size-xs --pl-radius-full
Accessibility
- It is an ordered list; Date values render as
<time datetime>. - Status is given in text (statusLabel), not by colour alone.
Usage guidelines
Do
- Order items the way people read them — usually newest first for feeds, oldest first for tracking.
Don’t
- Don’t put actions only in the timeline; link to the record instead.