Timeline
A vertical activity feed: an ordered list drawn as a connected rail of dots.
Live demo
Timeline turns a semantic ordered list into a vertical activity feed. Author an <ol> of <li> events and each one takes a themed dot on a connector rail that runs from one event to the next and stops at the last.
The dot and the rail are real nodes rendered by the component's fill, not lines painted onto the author's markup, so a mod can swap the dot for a per-event icon or draw the rail dashed — while each event's content is relocated into its content region untouched, and the rendered list stays a semantic <ol> screen readers hear in order. Inside an event, a <strong> reads as the title, a <time> as its timestamp, and a <p> as the body; the same styling is available through xtyle-timeline__title / __meta / __body classes if the markup can't use those elements.
When to use
How this component composes with the rest of the set.
Props
1 prop, straight from the manifest.
| Prop | Type | Default | Bindings | Description |
|---|---|---|---|---|
Anatomy
The named parts that make up the component, with their selectors.
list
The rendered ordered list; carries no bullets and no default spacing.
item
One event: its dot, the rail running to the next event, and its content. Carries any attributes the author put on the source <li>.
dot
The event's marker on the rail. A real node, so a mod can replace it with a per-event icon or status glyph.
rail
The line running from one event's dot down to the next. The last event has none, so the feed ends at its dot.
content
The region each event's authored content is relocated into, beside its dot.
title
The event title: a <strong> (or .xtyle-timeline__title).
meta
The timestamp or secondary line: a <time> (or .xtyle-timeline__meta).
body
The event body copy: a <p> (or .xtyle-timeline__body).
Tokens & coverage
What the component consumes, checked live against what the algorithm produces.
Live coverage check against the xtyle-default register
(derive(xtyleDefault, { anchors }) →
coverComponent(manifest, register)). Every token this component
consumes must be a key the algorithm produces.
--accent
--bg-0
--border-thick
--border-thin
--fg-0
--fg-1
--fg-2
--font-sans
--leading-normal
--leading-tight
--line
--radius-full
--space-1
--space-4
--space-5
--text-sm
--text-xs
--weight-semibold
Slots
The ordered list. Provide an <ol> (or <ul>) whose <li> children are the events. Each event's content is relocated into the rendered item's content region, and any attributes on the source <li> ride along onto the rendered item.
Accessibility
Code
Activity feed
An ordered list of events; each item takes a dot on the connector rail.
<xtyle-timeline>
<ol>
<li>
<strong>Deployed v0.6.0</strong>
<time>2 hours ago</time>
<p>The accessibility pass and the new gallery mockup went live.</p>
</li>
<li>
<strong>Merged the release branch</strong>
<time>yesterday</time>
</li>
<li>
<strong>Opened the milestone</strong>
<time>last week</time>
</li>
</ol>
</xtyle-timeline>
<script lang="ts">
import { Timeline } from "@xtyle/svelte";
</script>
<Timeline>
<ol>
<li><strong>Deployed v0.6.0</strong><time>2 hours ago</time></li>
<li><strong>Merged the release branch</strong><time>yesterday</time></li>
</ol>
</Timeline>
---
import Timeline from "@xtyle/astro/Timeline.astro";
---
<Timeline>
<ol>
<li><strong>Deployed v0.6.0</strong><time>2 hours ago</time></li>
<li><strong>Merged the release branch</strong><time>yesterday</time></li>
</ol>
</Timeline>