Timeline Examples
The examples below assume that you have imported the component and set up the theme.
Basic
Show the events of an order in a list, with the date on the other side of the line. A <time datetime> element in the opposite slot shows the date, and the description slot holds the text under the title.
Pick alternate in the placement control and drag the handle to see the items with no side move to one side below 22em of width.
<div class="timeline-basic"> <sv-timeline aria-label="Order history"> <sv-timeline-item> <time datetime="2026-03-28" slot="opposite">Mar 28</time> Order placed <span slot="description">Payment verified</span> </sv-timeline-item> <sv-timeline-item> <time datetime="2026-03-29" slot="opposite">Mar 29</time> Shipped <span slot="description">Picked up from the warehouse</span> </sv-timeline-item> <sv-timeline-item> <time datetime="2026-03-31" slot="opposite">Mar 31</time> In transit <span slot="description">Cleared customs in Leipzig</span> </sv-timeline-item> <sv-timeline-item> <time datetime="2026-04-01" slot="opposite">Apr 1</time> Out for delivery </sv-timeline-item> </sv-timeline></div>
<style> .timeline-basic { display: grid; grid-template-columns: minmax(0, 36rem); place-content: center; }</style>Markers
Show the state of each step of a deployment in its marker. variant colors the marker, the icon slot replaces the dot with an icon or an sv-spinner, and aria-busy="true" tells a screen reader that the item is changing.
The description slot says the result in words, because color alone must not carry meaning.
<div class="timeline-markers"> <sv-timeline aria-label="Deployment"> <sv-timeline-item variant="accent"> Started <span slot="description">Triggered by a push to main</span> </sv-timeline-item> <sv-timeline-item variant="info"> Cache <span slot="description">Restored 240 packages</span> </sv-timeline-item> <sv-timeline-item variant="success"> <!-- Check --> <svg aria-hidden="true" slot="icon" viewBox="0 0 24 24"> <path d="M20 6 9 17l-5-5" /> </svg> Build <span slot="description">Passed in 42 s</span> </sv-timeline-item> <sv-timeline-item variant="warning"> <!-- Exclamation mark --> <svg aria-hidden="true" slot="icon" viewBox="0 0 24 24"> <path d="M12 5v9m0 4v1" /> </svg> Lint <span slot="description">Passed with 3 warnings</span> </sv-timeline-item> <sv-timeline-item variant="error"> <!-- Cross --> <svg aria-hidden="true" slot="icon" viewBox="0 0 24 24"> <path d="M18 6 6 18M6 6l12 12" /> </svg> Deploy <span slot="description">Failed: the health check did not pass</span> </sv-timeline-item> <sv-timeline-item aria-busy="true"> <sv-spinner aria-label="In progress" slot="icon"></sv-spinner> Retry <span slot="description">Deploying again</span> </sv-timeline-item> </sv-timeline></div>
<style> .timeline-markers { display: grid; grid-template-columns: minmax(0, 36rem); place-content: center;
svg { inline-size: 1.25em; fill: none; stroke: currentcolor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; } }</style>Headings
Group a changelog by year. heading on an item removes its marker and its line, an <h3> in it makes it a real heading, and placement="alternate" centers the heading and leaves it out of its count.
In a frame narrower than 22em, the items sit on one side and the heading sits at the start.
2026
2025
<div class="timeline-headings"> <sv-timeline aria-label="Changelog" placement="alternate"> <sv-timeline-item heading><h3>2026</h3></sv-timeline-item> <sv-timeline-item> Version 3.0 <span slot="description">A new theme and a smaller bundle</span> </sv-timeline-item> <sv-timeline-item> Version 2.4 <span slot="description">Dark mode for the charts</span> </sv-timeline-item> <sv-timeline-item heading><h3>2025</h3></sv-timeline-item> <sv-timeline-item> Version 2.0 <span slot="description">Rewritten on web components</span> </sv-timeline-item> <sv-timeline-item> Version 1.0 <span slot="description">The first public release</span> </sv-timeline-item> </sv-timeline></div>
<style> .timeline-headings { display: grid; grid-template-columns: minmax(0, 36rem); place-content: center;
h3 { margin: 0; font-size: 1.125em; } }</style>Horizontal
Lay the events out in a row, like the milestones of a project. orientation="horizontal" gives each item a column of the same width, with the opposite slot above the line and the content below it.
Drag the handle to see how the text wraps in the columns.
<div class="timeline-horizontal"> <sv-timeline aria-label="Project milestones" orientation="horizontal"> <sv-timeline-item> <time datetime="2026-01" slot="opposite">January</time> Design <span slot="description">The first screens</span> </sv-timeline-item> <sv-timeline-item> <time datetime="2026-03" slot="opposite">March</time> Beta <span slot="description">Open to the team</span> </sv-timeline-item> <sv-timeline-item> <time datetime="2026-06" slot="opposite">June</time> Launch <span slot="description">Open to everyone</span> </sv-timeline-item> </sv-timeline></div>
<style> .timeline-horizontal { display: grid; }</style>