Skip to main content

Timeline

Vertical event flow. Semantic <ol> list where document order equals time order.

Basic usage​

Basic usage
  1. 2026-09-01
    Project review
  2. 2026-09-15
    Phase one delivered
  3. 2026-09-25
    Acceptance in progress
  1. Q1
    Planning
  2. Q2
    Development
  3. Q3
    Stress testing
  1. Q1
    Not started
  2. Q2
    In progress
  3. Q3
    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​

PropDescriptionTypeDefault
modeLayout mode (alternate switches sides)'left' | 'alternate''left'
sxShorthand layout propsSxProps—

TimelineItem Props​

PropDescriptionTypeDefault
timestampTimestampReactNode—
typeNode semantic type (colors the dot)'primary' | 'success' | 'warning' | 'danger'—
hollowHollow dotbooleanfalse
dotCustom dot contentReactNode—
sxShorthand layout propsSxProps—
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'