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
-
Brief approved Done
-
Design signed off Done
-
Build In progress
Maya Okafor is working on the checkout pages.
-
Review with you Upcoming
-
Launch Upcoming
Options
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} />;
}/* 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. */
.dh-timeline-card {
--accent: var(--dh-accent, #2563ff);
--line: color-mix(in srgb, var(--dh-fg, #171717) 9%, transparent);
--ease: cubic-bezier(0.23, 1, 0.32, 1);
width: 340px;
max-width: 100%;
overflow: hidden;
border-radius: 14px;
background: var(--dh-raised, #fff);
box-shadow:
0 0 0 1px var(--line),
0 1px 2px color-mix(in srgb, var(--dh-fg, #171717) 10%, transparent);
color: var(--dh-fg, #171717);
font-family: inherit;
font-size: 13px;
line-height: 20px;
text-align: left;
}
.dh-timeline-card *,
.dh-timeline-card *::before,
.dh-timeline-card *::after {
box-sizing: border-box;
}
.dh-timeline-card :is(h3, p, ol) {
margin: 0;
padding: 0;
}
.dh-timeline-card header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 16px 13px;
border-bottom: 1px solid var(--line);
}
.dh-timeline-card h3 {
font-size: 14px;
font-weight: 500;
letter-spacing: -0.015em;
}
.dh-timeline-card h3 em {
margin-left: 4px;
padding: 1px 5px;
border-radius: 4px;
background: color-mix(in srgb, #1fa750 12%, transparent);
color: color-mix(in srgb, #1fa750 72%, var(--dh-fg, #171717));
font-size: 11px;
font-style: normal;
letter-spacing: 0;
vertical-align: 1px;
}
.dh-timeline-card header p {
color: var(--dh-muted, #5c5c5c);
font-size: 12px;
line-height: 16px;
}
/* How far along the project is, as a short bar. */
.dh-timeline-meter {
flex: none;
width: 48px;
height: 4px;
overflow: hidden;
border-radius: 2px;
background: var(--dh-well, #ededeb);
}
.dh-timeline-meter i {
display: block;
width: calc(var(--done) / var(--of) * 100%);
height: 100%;
border-radius: inherit;
background: var(--accent);
}
.dh-timeline {
display: grid;
padding: 14px 16px 6px !important;
list-style: none;
}
/* Each step is a marker, a title with its date at the far side, and
sometimes a note. The line to the next step hangs under the marker. */
.dh-timeline li {
position: relative;
display: grid;
grid-template-columns: 16px 1fr auto;
column-gap: 10px;
align-items: center;
padding-bottom: 14px;
animation: dh-timeline-in 0.4s var(--ease) both;
}
.dh-timeline li:nth-child(2) { animation-delay: 40ms; }
.dh-timeline li:nth-child(3) { animation-delay: 80ms; }
.dh-timeline li:nth-child(4) { animation-delay: 120ms; }
.dh-timeline li:nth-child(5) { animation-delay: 160ms; }
.dh-timeline li::before {
content: "";
position: absolute;
top: 21px;
bottom: -1px;
left: 7.5px;
border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.dh-timeline li:is([data-state="now"], [data-state="next"])::before {
border-left: 1px dashed color-mix(in srgb, var(--dh-fg, #171717) 22%, transparent);
}
.dh-timeline li:last-child::before {
display: none;
}
.dh-timeline-mark {
display: grid;
place-items: center;
width: 16px;
height: 16px;
border-radius: 50%;
}
.dh-timeline li > p:not(.dh-timeline-text) {
font-weight: 500;
letter-spacing: -0.01em;
}
/* Says the state in words for screen readers. The marker shows it to everyone else. */
.dh-timeline-note {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.dh-timeline time {
color: var(--dh-faint, #8a8a8a);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
}
.dh-timeline .dh-timeline-text {
grid-column: 2 / -1;
margin-top: 6px;
padding: 6px 10px;
border-radius: 7px;
background: color-mix(in srgb, var(--accent) 7%, transparent);
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
color: var(--dh-muted, #5c5c5c);
font-size: 12px;
line-height: 18px;
}
.dh-timeline [data-state="done"] .dh-timeline-mark {
background: linear-gradient(color-mix(in srgb, var(--accent) 84%, #fff), var(--accent));
box-shadow:
inset 0 1px 0 rgb(255 255 255 / 0.3),
0 0 0 1px color-mix(in srgb, var(--accent) 78%, #000);
}
.dh-timeline-mark svg {
width: 10px;
height: 10px;
fill: none;
stroke: var(--dh-on-accent, #fff);
stroke-width: 1.75;
stroke-linecap: round;
stroke-linejoin: round;
}
/* The step in progress: a dot inside a soft ring that breathes. */
.dh-timeline [data-state="now"] .dh-timeline-mark {
position: relative;
background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.dh-timeline [data-state="now"] .dh-timeline-mark::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
}
.dh-timeline [data-state="now"] .dh-timeline-mark::after {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
animation: dh-timeline-ring 2.4s ease-out infinite;
}
.dh-timeline [data-state="next"] .dh-timeline-mark {
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dh-fg, #171717) 22%, transparent);
}
.dh-timeline [data-state="next"] > p {
color: var(--dh-muted, #5c5c5c);
font-weight: 400;
}
@keyframes dh-timeline-in {
from {
opacity: 0;
filter: blur(4px);
transform: translateY(-4px);
}
}
@keyframes dh-timeline-ring {
from {
opacity: 1;
transform: scale(1);
}
70%,
to {
opacity: 0;
transform: scale(1.9);
}
}
@media (prefers-reduced-motion: reduce) {
.dh-timeline li,
.dh-timeline [data-state="now"] .dh-timeline-mark::after {
animation: none;
}
}<section class="dh-timeline-card">
<header>
<div>
<h3>Website redesign <em>On track</em></h3>
<p>Logoipsum, launching 30 March</p>
</div>
<span class="dh-timeline-meter" role="img" aria-label="2 of 5 steps done"><i style="--done: 2; --of: 5"></i></span>
</header>
<ol class="dh-timeline">
<li data-state="done">
<span class="dh-timeline-mark" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M2.75 6.25 5 8.5l4.25-5" /></svg></span>
<p>Brief approved <span class="dh-timeline-note">Done</span></p>
<time datetime="2026-03-02">2 Mar</time>
</li>
<li data-state="done">
<span class="dh-timeline-mark" aria-hidden="true"><svg viewBox="0 0 12 12"><path d="M2.75 6.25 5 8.5l4.25-5" /></svg></span>
<p>Design signed off <span class="dh-timeline-note">Done</span></p>
<time datetime="2026-03-09">9 Mar</time>
</li>
<li data-state="now" aria-current="step">
<span class="dh-timeline-mark" aria-hidden="true"></span>
<p>Build <span class="dh-timeline-note">In progress</span></p>
<time datetime="2026-03-16">16 Mar</time>
<p class="dh-timeline-text">Maya Okafor is working on the checkout pages.</p>
</li>
<li data-state="next">
<span class="dh-timeline-mark" aria-hidden="true"></span>
<p>Review with you <span class="dh-timeline-note">Upcoming</span></p>
<time datetime="2026-03-24">24 Mar</time>
</li>
<li data-state="next">
<span class="dh-timeline-mark" aria-hidden="true"></span>
<p>Launch <span class="dh-timeline-note">Upcoming</span></p>
<time datetime="2026-03-30">30 Mar</time>
</li>
</ol>
</section>/* 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. */
.dh-timeline-card {
--accent: var(--dh-accent, #2563ff);
--line: color-mix(in srgb, var(--dh-fg, #171717) 9%, transparent);
--ease: cubic-bezier(0.23, 1, 0.32, 1);
width: 340px;
max-width: 100%;
overflow: hidden;
border-radius: 14px;
background: var(--dh-raised, #fff);
box-shadow:
0 0 0 1px var(--line),
0 1px 2px color-mix(in srgb, var(--dh-fg, #171717) 10%, transparent);
color: var(--dh-fg, #171717);
font-family: inherit;
font-size: 13px;
line-height: 20px;
text-align: left;
}
.dh-timeline-card *,
.dh-timeline-card *::before,
.dh-timeline-card *::after {
box-sizing: border-box;
}
.dh-timeline-card :is(h3, p, ol) {
margin: 0;
padding: 0;
}
.dh-timeline-card header {
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
padding: 14px 16px 13px;
border-bottom: 1px solid var(--line);
}
.dh-timeline-card h3 {
font-size: 14px;
font-weight: 500;
letter-spacing: -0.015em;
}
.dh-timeline-card h3 em {
margin-left: 4px;
padding: 1px 5px;
border-radius: 4px;
background: color-mix(in srgb, #1fa750 12%, transparent);
color: color-mix(in srgb, #1fa750 72%, var(--dh-fg, #171717));
font-size: 11px;
font-style: normal;
letter-spacing: 0;
vertical-align: 1px;
}
.dh-timeline-card header p {
color: var(--dh-muted, #5c5c5c);
font-size: 12px;
line-height: 16px;
}
/* How far along the project is, as a short bar. */
.dh-timeline-meter {
flex: none;
width: 48px;
height: 4px;
overflow: hidden;
border-radius: 2px;
background: var(--dh-well, #ededeb);
}
.dh-timeline-meter i {
display: block;
width: calc(var(--done) / var(--of) * 100%);
height: 100%;
border-radius: inherit;
background: var(--accent);
}
.dh-timeline {
display: grid;
padding: 14px 16px 6px !important;
list-style: none;
}
/* Each step is a marker, a title with its date at the far side, and
sometimes a note. The line to the next step hangs under the marker. */
.dh-timeline li {
position: relative;
display: grid;
grid-template-columns: 16px 1fr auto;
column-gap: 10px;
align-items: center;
padding-bottom: 14px;
animation: dh-timeline-in 0.4s var(--ease) both;
}
.dh-timeline li:nth-child(2) { animation-delay: 40ms; }
.dh-timeline li:nth-child(3) { animation-delay: 80ms; }
.dh-timeline li:nth-child(4) { animation-delay: 120ms; }
.dh-timeline li:nth-child(5) { animation-delay: 160ms; }
.dh-timeline li::before {
content: "";
position: absolute;
top: 21px;
bottom: -1px;
left: 7.5px;
border-left: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
}
.dh-timeline li:is([data-state="now"], [data-state="next"])::before {
border-left: 1px dashed color-mix(in srgb, var(--dh-fg, #171717) 22%, transparent);
}
.dh-timeline li:last-child::before {
display: none;
}
.dh-timeline-mark {
display: grid;
place-items: center;
width: 16px;
height: 16px;
border-radius: 50%;
}
.dh-timeline li > p:not(.dh-timeline-text) {
font-weight: 500;
letter-spacing: -0.01em;
}
/* Says the state in words for screen readers. The marker shows it to everyone else. */
.dh-timeline-note {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip-path: inset(50%);
white-space: nowrap;
}
.dh-timeline time {
color: var(--dh-faint, #8a8a8a);
font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
font-size: 11px;
}
.dh-timeline .dh-timeline-text {
grid-column: 2 / -1;
margin-top: 6px;
padding: 6px 10px;
border-radius: 7px;
background: color-mix(in srgb, var(--accent) 7%, transparent);
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 14%, transparent);
color: var(--dh-muted, #5c5c5c);
font-size: 12px;
line-height: 18px;
}
.dh-timeline [data-state="done"] .dh-timeline-mark {
background: linear-gradient(color-mix(in srgb, var(--accent) 84%, #fff), var(--accent));
box-shadow:
inset 0 1px 0 rgb(255 255 255 / 0.3),
0 0 0 1px color-mix(in srgb, var(--accent) 78%, #000);
}
.dh-timeline-mark svg {
width: 10px;
height: 10px;
fill: none;
stroke: var(--dh-on-accent, #fff);
stroke-width: 1.75;
stroke-linecap: round;
stroke-linejoin: round;
}
/* The step in progress: a dot inside a soft ring that breathes. */
.dh-timeline [data-state="now"] .dh-timeline-mark {
position: relative;
background: color-mix(in srgb, var(--accent) 16%, transparent);
}
.dh-timeline [data-state="now"] .dh-timeline-mark::before {
content: "";
width: 6px;
height: 6px;
border-radius: 50%;
background: var(--accent);
}
.dh-timeline [data-state="now"] .dh-timeline-mark::after {
content: "";
position: absolute;
inset: 0;
border-radius: 50%;
box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 50%, transparent);
animation: dh-timeline-ring 2.4s ease-out infinite;
}
.dh-timeline [data-state="next"] .dh-timeline-mark {
box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--dh-fg, #171717) 22%, transparent);
}
.dh-timeline [data-state="next"] > p {
color: var(--dh-muted, #5c5c5c);
font-weight: 400;
}
@keyframes dh-timeline-in {
from {
opacity: 0;
filter: blur(4px);
transform: translateY(-4px);
}
}
@keyframes dh-timeline-ring {
from {
opacity: 1;
transform: scale(1);
}
70%,
to {
opacity: 0;
transform: scale(1.9);
}
}
@media (prefers-reduced-motion: reduce) {
.dh-timeline li,
.dh-timeline [data-state="now"] .dh-timeline-mark::after {
animation: none;
}
}Timeline is not in the Figma file yet.
Use the React or HTML code for now.