Skip to main content

Basic

Events in order, one after another, with a line that joins the markers. It is an ordered list (ol), so a screen reader counts the events, and each time is a <time datetime>. The markers are decorative. The line is drawn by every item except the last (group-last/ev:hidden).

  1. Order placed

    Order 2041 was placed by Alex Morgan.

  2. Payment received

    We received $129.99.

  3. Shipped

    Your package is on its way.

  4. Delivered

Icons and variants

An icon in a coloured circle tells the kind of event: info, success, warning, danger. The title says the same in words, so colour and icon are never the only cue.

  1. Deployment started

    Build 218 started.

  2. Tests passed

    482 tests ran with no failures.

  3. Slow response

    The checkout page took 4.2 s to answer.

  4. Rolled back

    Build 218 was rolled back to build 217.

Activity feed

Who did what, with the person’s initials instead of an icon. Use the time with a relative text (“2 hours ago”) and keep the exact date in datetime, so the person can still find the moment.

  1. Alex Morgan changed the price of Portable SSD

    From $139.99 to $129.99.

  2. Jordan Lee added a photo

  3. Sam Kim published the product

    It is now visible in the store.

Grouped by day

A long history is split by day. Each group is a section named by its heading (aria-labelledby), so a screen reader user can jump from day to day with the heading keys.

Today

  1. Backup finished

    2.4 GB saved.

  2. Low stock

    Portable SSD has 3 units left.

Yesterday

  1. New customer

    Jordan Lee signed up.

  2. Refund issued

    Order 2038, $59.00.

Options reference

The timeline is plain HTML and Tailwind classes, with no script.

Part Value Description
ol element The list of events, with aria-label or aria-labelledby to name it.
li group/ev relative flex gap-4 pb-8 last:pb-0 One event. The name ev lets the line hide on the last item.
Marker size-8 circle An icon, initials or a dot; always aria-hidden="true". Variant: dominant, primary, success, info, warning, danger.
Line absolute top-8 bottom-0 left-4 w-0.5 From the marker to the next one; group-last/ev:hidden hides it on the last event.
time datetime The moment in ISO format. The visible text can be relative.
Group section with a heading For a history split by day or month.