Timeline
Vertical event flow. Semantic <ol> list where document order equals time order.
Basic usage
Basic usage
- Project review
- Phase one delivered
- Acceptance in progress
- Planning
- Development
- Stress testing
- Not started
- In progress
- Completed
import { LhTimeline, LhTimelineItem } from '@lh-ui/react'
export default function Demo() {
return (
<LhTimeline>
<LhTimelineItem timestamp="2026-09-01">Project review</LhTimelineItem>
<LhTimelineItem timestamp="2026-09-15" type="success">
Phase one delivered
</LhTimelineItem>
<LhTimelineItem timestamp="2026-09-25" type="warning">
Acceptance in progress
</LhTimelineItem>
</LhTimeline>
)
}
mode="alternate" enables the alternating left / right layout; hollow renders the node as a hollow dot, commonly used for unfinished states.
Timeline Props
| Prop | Description | Type | Default |
|---|---|---|---|
| mode | Layout mode (alternate switches sides) | 'left' | 'alternate' | 'left' |
| sx | Shorthand layout props | SxProps | — |
TimelineItem Props
| Prop | Description | Type | Default |
|---|---|---|---|
| timestamp | Timestamp | ReactNode | — |
| type | Node semantic type (colors the dot) | 'primary' | 'success' | 'warning' | 'danger' | — |
| hollow | Hollow dot | boolean | false |
| dot | Custom dot content | ReactNode | — |
| sx | Shorthand layout props | SxProps | — |
Slot mapping
The three plus slots are merged into React props: #default → children, #timestamp → timestamp, #dot → dot.
Child node restriction
children must be LhTimelineItem elements directly (you may render them with .map); they cannot be wrapped in a custom component — the parent injects index / isLast by filtering child element types via Children.toArray, and wrapping breaks the last-item connector line and alternate side computation.
Accessibility
- Semantic
<ol>; screen readers announce items in time order - Dots are decorative (
aria-hidden="true"); custom dot content likewise stays out of the accessibility tree
ref
forwardRef<HTMLOListElement> — the <ol> root element. LhTimelineItem forwards HTMLLIElement.
Styles
import '@lh-ui/react/style/timeline'