Skip to content

Timeline

hc-timeline renders activity history — audit logs, deployment events, order status — as a plain <ol> with a marker rail and connector line. Pure CSS: the list semantics are the accessibility story, statuses ride on data-variant, and RTL flips for free (logical properties).

  1. Deploy finished

    v2.4 to production.

  2. Smoke test flaky

    Retried once, then green.

  3. Build started

__time and __description are optional; a title-only item works. The connector line stops at the last item automatically.

data-variant on an item colors its marker via the status tokens: success, warning, error, info. Without it the marker is a neutral hollow dot. The optional glyph inside the marker is decorative — keep it aria-hidden and put the meaning in the title.

  1. Deploy finished
  2. Smoke test flaky
  3. Rollback triggered
  4. Maintenance window opened

An activity feed is a list of server-rendered items — prepend new events with an out-of-band swap, or refresh via SSE (see the sse-updates recipe):

<ol class="hc-timeline" id="audit-log"
data-hx-get="/audit?page=2" data-hx-trigger="revealed from:#log-more"
data-hx-swap="beforeend">
</ol>

Newest-first or oldest-first is your choice — the component draws the same either way; announce the order in the list’s aria-label if it is not obvious.

  • It is a list: <ol>/<li> are announced with position and count. Give the list an aria-label when the heading doesn’t already name it.
  • Use <time datetime="…"> for machine-readable timestamps.
  • Marker glyphs are decorative (aria-hidden="true") — the title text carries the meaning, so the status is never color-only.

Component tokens (in component.tokens.json):

Token pathPurpose
timeline.marker-sizeMarker diameter.
timeline.marker-bg / marker-fg / marker-border / marker-border-sizeNeutral marker.
timeline.line-size / line-colorConnector segment.
timeline.gapColumn gap between rail and content.
timeline.item-gapVertical gap between items.
timeline.time-fg / time-font-sizeTimestamp text.
timeline.title-fg / title-font-weightTitle text.
timeline.description-fg / description-font-sizeDescription text.
timeline.success-bg / warning-bg / error-bg / info-bg / status-fgVariant markers.
Show the generated CSS variables
--hc-timeline-marker-size | -marker-bg | -marker-fg | -marker-border | -marker-border-size
--hc-timeline-line-size | -line-color | -gap | -item-gap
--hc-timeline-time-fg | -time-font-size
--hc-timeline-title-fg | -title-font-weight
--hc-timeline-description-fg | -description-font-size
--hc-timeline-success-bg | -warning-bg | -error-bg | -info-bg | -status-fg
  • Item — the flat row primitive for feeds without the rail metaphor.
  • Stepper — for process steps the user moves through, rather than history.
  • Status colors — the shared tokens behind the variant markers.