Timeline
Follow what happened, newest first, grouped by day.
npx shadcn@latest add @silicon-ui/timelineInstallation
With the shadcn CLI
npx shadcn@latest add @silicon-ui/timelineManually
Install the dependencies
npm install lucide-react motionCopy these files into your project
- components/silicon-ui/timeline/timeline.tsx
- components/silicon-ui/timeline/timeline.module.css
Add the foundation, once per app, for the design and motion tokens
npx shadcn@latest add @silicon-ui/silicon-foundation
Usage
API reference
| Prop | Type | Default |
|---|---|---|
events*Updates in any order; the newest shows first. | TimelineEvent[] | — |
now*Reference time for relative labels and day groups, in epoch milliseconds. Pass a ticking clock to keep labels fresh. | number | — |
label*Accessible name for the feed. | string | — |
timeZoneTime zone for day groups and clock times. Fixed by default so server and client agree. | string | "UTC" |
locale | string | "en-US" |
maxHeightHeight of the scrolling area. Without it the feed grows with the page and reveals on page scroll. | number | string | — |
scrollToNewScroll back to the top when a new update arrives while the feed is scrolled down. | boolean | true |
defaultExpanded | string[] | [] |
headingLevelHeading level for the day labels. | 2 | 3 | 4 | 5 | 6
| 3 |
className | string | — |
Dependencies
- npm
- lucide-reactmotion
- Registry
- silicon-motion-tokens