Timeline

A vertical project timeline in a card: a tick in your accent colour for each step that is done, a ringed dot for the one in progress, and empty rings on a dashed line for what is still to come.

Website redesign On track

Logoipsum, launching 30 March

  1. Brief approved Done

  2. Design signed off Done

  3. Build In progress

    Maya Okafor is working on the checkout pages.

  4. Review with you Upcoming

  5. Launch Upcoming

Options

Screen
Colour

Code

import "./timeline.css";

const words = { done: "Done", now: "In progress", next: "Upcoming" };

/* <Timeline steps={[{ title: "Brief approved", when: "2 Mar", date: "2026-03-02", state: "done" }]} />
   A step's state is "done", "now" or "next". */
export function Timeline({ steps }) {
  return (
    <ol className="dh-timeline">
      {steps.map((step) => (
        <li key={step.title} data-state={step.state} aria-current={step.state === "now" ? "step" : undefined}>
          <span className="dh-timeline-mark" aria-hidden="true">
            {step.state === "done" && (
              <svg viewBox="0 0 12 12">
                <path d="M2.75 6.25 5 8.5l4.25-5" />
              </svg>
            )}
          </span>
          <p>
            {step.title} <span className="dh-timeline-note">{words[step.state]}</span>
          </p>
          <time dateTime={step.date}>{step.when}</time>
          {step.text && <p className="dh-timeline-text">{step.text}</p>}
        </li>
      ))}
    </ol>
  );
}

/* The timeline in a card, with the project's name, a status chip and a short
   bar that shows how many steps are done. */
export function TimelineCard({ title, status, note, steps }) {
  const done = steps.filter((step) => step.state === "done").length;
  return (
    <section className="dh-timeline-card">
      <header>
        <div>
          <h3>
            {title} {status && <em>{status}</em>}
          </h3>
          <p>{note}</p>
        </div>
        <span className="dh-timeline-meter" role="img" aria-label={done + " of " + steps.length + " steps done"}>
          <i style={{ "--done": done, "--of": steps.length }} />
        </span>
      </header>
      <Timeline steps={steps} />
    </section>
  );
}

const project = [
  { title: "Brief approved", when: "2 Mar", date: "2026-03-02", state: "done" },
  { title: "Design signed off", when: "9 Mar", date: "2026-03-09", state: "done" },
  { title: "Build", when: "16 Mar", date: "2026-03-16", state: "now", text: "Maya Okafor is working on the checkout pages." },
  { title: "Review with you", when: "24 Mar", date: "2026-03-24", state: "next" },
  { title: "Launch", when: "30 Mar", date: "2026-03-30", state: "next" },
];

export function Example() {
  return <TimelineCard title="Website redesign" status="On track" note="Logoipsum, launching 30 March" steps={project} />;
}

Website redesign On track

Logoipsum, launching 30 March

  1. Brief approved Done

  2. Design signed off Done

  3. Build In progress

    Maya Okafor is working on the checkout pages.

  4. Review with you Upcoming

  5. Launch Upcoming