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

  1. ← timeline-item
  2. ← timeline-group

    Today

      items
PartTokenWhy
Railbg-border, 1px, down the middle of the marker columnQuiet: it joins, it does not compete.
Marker column32px; 24px dense
Icon markerthe tone's tint: bg-{tone}-tint text-on-{tone}-tintThe badge's recipe.
Dot marker10px (8 dense), the tone's solidFor entries with nothing to show.
Avatar markerds::avatar, sm, decorativeThe title names the person.
Cut-outring-4 of --ds-timeline-bg (default the surface)The rail runs behind the markers and stops short of each one.
Titletext-body, medium, text-fg
Timetext-meta, text-fg-muted, tabular
Bodytext-body, text-fg-muted, breaks long wordsA URL wraps instead of widening the column.
Group headingtext-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):

railsolid or dashed, above.
marker slotReplaces 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, openWith 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

timeShown<time datetime>
a DateTimeInterfacethe locale's medium date and time (isoFormat('LLL')), or timeFormatISO 8601
an ISO 8601 string (2026-11-10, 2026-11-10T09:31:00Z)the same, date only for a dateISO 8601
anything else ("Yesterday", "10:42")as writtendatetime, 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

Structurean ordered list; a group is an item holding a heading and its own list
Namelabel names the list (aria-label)
Markersaria-hidden: the icon, the dot and the avatar repeat the title, and the tone is colour
Time<time datetime> where the moment is known
Keyboardonly what the host puts in: the title link, the actions
Heading levellevel 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.

Was this page helpful?