Timeline
Events in order, with a rail joining their markers: an order's history, an
audit log, an activity feed. ds::timeline is the list, ds::timeline-item
an entry, ds::timeline-group a run of entries under a sticky heading
("Today"). Plain Blade and CSS: no Alpine, no script.
Anatomy
- ← timeline-item
← its piece of the rail
- ← timeline-group
Today
items
| Part | Token | Why |
|---|---|---|
| Rail | bg-border, 1px, down the middle of the marker column | Quiet: it joins, it does not compete. |
| Marker column | 32px; 24px dense | |
| Icon marker | the tone's tint: bg-{tone}-tint text-on-{tone}-tint | The badge's recipe. |
| Dot marker | 10px (8 dense), the tone's solid | For entries with nothing to show. |
| Avatar marker | ds::avatar, sm, decorative | The title names the person. |
| Cut-out | ring-4 of --ds-timeline-bg (default the surface) | The rail runs behind the markers and stops short of each one. |
| Title | text-body, medium, text-fg | |
| Time | text-meta, text-fg-muted, tabular | |
| Body | text-body, text-fg-muted, breaks long words | A URL wraps instead of widening the column. |
| Group heading | text-meta, semibold, text-fg-muted, sticky |
The rail
Each item draws its own piece of the rail, the full height of its box,
behind its marker: from the marker down on the first item, up to the marker
on the last, none on an item alone. So the rail joins the first marker to
the last and never runs past either, and however long a body is, the item
grows and its piece of the rail with it. No item needs to know its
neighbours; CSS :first-child, :last-child and :only-child decide.
Inside a group the same holds within the group, so the rail breaks at each heading, as the time it marks does.
rail="dashed" draws an item's piece as a dashed border-border-strong
line on the same 1px box, for what has not happened yet (ds::agent-timeline
dashes its pending, running and waiting rows). A step stronger than the solid
bg-border, so its gaps do not fade it out.
Added for the agent timeline (batch 23)
Three options, each changing nothing when left out (TimelineUnchangedTest
holds an item without them byte for byte to the output before they existed):
rail | solid or dashed, above. |
marker slot | Replaces what is drawn inside the marker, keeping its ring cut out of the rail. ds::agent-timeline puts a pulsing loader there for a running row. |
collapsible, open | With a body or actions: the title line becomes a native details element's summary (spans, a chevron, no link, since a summary is itself the control), and the body and actions open under it. x-ds-keep-toggle, an enhancement, keeps the reader's choice over a re-render. |
title may also be passed as a named slot, which ds::agent-timeline uses to
put an actor and a duration in the title line.
Time
time | Shown | <time datetime> |
|---|---|---|
a DateTimeInterface | the locale's medium date and time (isoFormat('LLL')), or timeFormat | ISO 8601 |
an ISO 8601 string (2026-11-10, 2026-11-10T09:31:00Z) | the same, date only for a date | ISO 8601 |
| anything else ("Yesterday", "10:42") | as written | datetime, when given; otherwise a plain span |
timeFormat="relative" shows "3 hours ago" (Carbon, the app's locale) with
the full date as its title: a relative time is computed at render and goes
stale on a page left open. A PHP date format string is used as given.
Dense
dense on the timeline: 24px markers, a smaller icon and dot, less space
between entries. The items read it from data-dense on the list through a
named group, not through Blade's aware directive, so items rendered by a
Livewire child or a partial are dense too.
Sticky headings
A group's heading is position: sticky at the top of the nearest scrolling
box, so it stays while its entries pass under it. It needs a background to
hide them: the surface by default. On another colour set --ds-timeline-bg
on any ancestor ([--ds-timeline-bg:var(--color-surface-subtle)]), which
the markers' cut-outs use too; under a sticky page header set
--ds-timeline-top to its height.
Accessibility
| Structure | an ordered list; a group is an item holding a heading and its own list |
| Name | label names the list (aria-label) |
| Markers | aria-hidden: the icon, the dot and the avatar repeat the title, and the tone is colour |
| Time | <time datetime> where the moment is known |
| Keyboard | only what the host puts in: the title link, the actions |
| Heading level | level on the group, 2 to 6, default 3, to fit the page's outline |
The title must say what happened, including the person when there is an avatar and the outcome when there is a tone: "Payment failed", never a red dot alone.
Load more, with Livewire
Render the items in a Livewire component's view inside one ds::timeline
and append pages: the list stays one list, the rail joins the new items to
the old because the last item is only last until more arrive, and nothing
needs re-initialising. docs/components/timeline.md has the example.
Do not
- Do not let the tone carry the meaning. The title says it.
- Do not nest timelines. A group is the one level of structure.
- Do not reverse the order with CSS. The order is the list's; sort the data.
- Do not put a timeline in a horizontal row. It is a column; a horizontal sequence of states is a stepper.
From the package repo: edit this page on GitHub.