Timeline
Vertical or horizontal event timeline with dot, connector and item content slots. Supports alternating layout, custom intents per item, and scroll-snapping in horizontal mode.
Preview
Rendering the live preview…
vertical 3 itemsStructure
Anatomy
Visual breakdown of the component's internal structure with BEM class call-outs.
<origam-timeline> — 4 internal parts: root list ①, dot ②, connector ③ and content area ④ per item.- 1.origam-timeline
- Root element with role="list". Contains a track-wrapper div in horizontal mode.
- 2.origam-timeline-item__dot
- Circular dot. Background color driven by the item intent via --origam-timeline-item---dot-bg. Hosts the #dot slot (icon by default when icon prop is set).
- 3.origam-timeline-item__connector
- Vertical (or horizontal) line connecting consecutive dots. Hidden on the last item when truncateLine=true.
- 4.origam-timeline-item__content
- Content area next to the dot. Contains the header (title + subtitle) and an optional body. Hosts the #default and #body slots.
API
Props
All props accepted by this component, with their type, default value and description.
- itemsITimelineEntry[]
- Array of timeline entries. Each entry has title, subtitle, description, icon and intent. When provided, OrigamTimelineItem is rendered automatically.
- Layout direction. 'vertical' (default): dots stacked top→bottom. 'horizontal': dots in a scroll-snapping row, content below.
- sideTTimelineSide'start'
- Which side the content appears on in vertical mode. 'alternating' places odd items on the start side and even items on the end side.
- truncateLinebooleanfalse
- When true, the connector line is hidden on the last item (no trailing connector).
- ariaLabelstring
- aria-label for the timeline list root (role="list").
- idstring
- classstring | Array<string> | object
- stylestring | Array<string> | object | StyleValue
- tagstring'div'
- HTML element rendered at root.
- color
- Default intent color for dots when no per-item intent is set.
- Dot size token. Overrides the --origam-timeline---dot-size token.
- Adjusts the gap between items.
API
Slots
Content slots exposed by this component.
- #default
- Slot for manual OrigamTimelineItem children. Overrides the items prop. Use when you need per-item slot customisation.
API
Exposed members
Properties and methods accessible via template ref (defineExpose). Use them for programmatic control.
- <T extends object>(props: T, exclude?: string[]) => Partial<T>
- Utility to forward a filtered subset of props to a child component.
- Ref<string>
- Reactive CSS string generated by useStyle.
- string
- Unique style-sheet ID for this instance.
- () => void
- Injects the computed style sheet into the document.
- () => void
- Removes the injected style sheet.
- Ref<boolean>
- True once the style sheet has been injected into the DOM.
Customisation
CSS variables
CSS custom properties exposed by this component. Override them to customise the component without losing theme compatibility.
- Gap between timeline items and between the dot and content.
- Diameter of the dot.
- Default dot background color (overridden per item by intent).
- Default dot foreground (icon) color.
- Color of the connector line between dots.
- Width/height of the connector line.
- Width of the track column (dot + connector area).
- Font size of the item title.
- Color of the item subtitle and body text.
Inclusion
Accessibility
ARIA roles, keyboard navigation and focus management. Sourced from the real component template.
ARIA roles
Keyboard interactions
| Key | Action |
|---|---|
| Tab | Moves focus between interactive elements inside the timeline items (links, buttons in content slots). |
Notes
- The root element has role="list". Each OrigamTimelineItem has role="listitem". Screen readers announce the number of items in the timeline.
- Provide an ariaLabel prop to describe the timeline purpose (e.g. "Project history"). Without it, screen readers will not contextualise the list.
- The track column (dot + connector) has aria-hidden="true" — it is decorative. Meaningful content lives in the content area.
Foundation
Design tokens
Excerpt from this component's token declarations — the --origam-<component>---<property> variables, declared in its hand-maintained token sheet with no build step.
- dimensionvar(--origam-space---4)
- Gap between items.
- dimensionvar(--origam-space---3)
- Dot diameter.
- colorvar(--origam-color__action--primary---bg)
- Default dot background color.
- colorvar(--origam-color__border---subtle)
- Connector line color.
- dimensionvar(--origam-border__width---thin)
- Connector line width.
- fontWeightvar(--origam-font__weight---semibold)
- Title font weight.
Interactive
Playground
Edit props live and see the component update in real time. The generated code snippet updates as you change values.
Rendering the live preview…
Usage
Examples
Ready-to-paste code snippets for your templates.
Basic vertical timeline
Alternating layout
Horizontal scroll-snap
Ecosystem
Family
Components from the same folder that share conventions and often compose together.