Timeline

Usage

Each event is an <li>: text followed by a <time>. Put the newest at the top.

  1. Payment captured
  2. Order #1042 placed

An event that opens to show details

Put a <details> in the event. The <summary> is the heading (it gets its own arrow) and a <dl> holds the details. Add open to start it open.

  1. Refund issued
    Amount
    $52.00
    Reason
    Item arrived damaged
  2. Delivered

Error events

data-variant="danger" turns the dot and text red. The time stays grey. data-variant="ok" (green dot) works the same way.

  1. Subscription renewal payment failed
    Reason
    Card declined
  2. Uploading tracking information failed
  3. Status changed from Active to Past due by the system
  4. Payment captured

Steps of a job

An .icon or .loader placed first in an event replaces the dot. Add aria-busy="true" to the step in progress and data-variant="pending" to steps not started yet (grey text, hollow dot).

  1. Creating your account
  2. Initializing your store
  3. Importing products

Steps played by a script

The page script changes the attributes itself. The running step gets a .loader, which turns into a check icon when done, then the next step starts. Timeline has no JS of its own.

  1. Creating your account
  2. Initializing your store
  3. Importing products

A note with Edit and Delete

A staff note is an <article> in the event: an <h4> author name, a <time>, a <p> message and a <footer> of buttons. Show the buttons only while the note can still be edited.

  1. Order placed on hold
  2. James Carter

    The address looks wrong. Emailed the customer to confirm it before shipping.

  3. Order placed

A form for adding a note

The first event is a <form> with a <textarea> and a <footer> of buttons plus a <small> hint. In the example, the page script adds the new note below the form on Save. Cancel is a type="reset" button.

  1. Notes are editable for 5 minutes.
  2. Confirmation email sent
  3. Fulfillment status changed from Unfulfilled to On hold

Attributes

Attribute / element Values Description
ol.timeline List of events, newest at the top
> li One event, with a dot and a line to the next event (except the last)
li[data-variant] ok, danger, pending; none = default (grey dot) ok: green dot and leading icon. danger: red dot and text. pending: a step not started yet, with grey text and a hollow dot
li[aria-busy] true Tells screen readers this step is in progress (pair with .loader)
li > .icon:first-child, li > .loader:first-child An icon or loader placed first replaces the dot
time datetime Time of the event, on its own line in small grey text
details > summary open An event that opens to show details. The summary gets its own arrow
dl > dt + dd Name/value details in two columns inside a frame
article A note: h4 author and time on one line, followed by p and footer
footer Button row of a note or form. A small inside it is a grey hint
form, textarea Add-note form in an event; the textarea is full width