Scroll Timeline
Pinned fullscreen year timeline — vertical scroll collapses each panel horizontally via clip-path while the oversized year rotates around its bottom-left anchor, exposing the next era underneath. Fully reversible and driven directly by scroll progress.
Installation#
pnpm dlx shadcn@latest add @davinciui/scroll-timelineUsage#
API Reference#
| Prop | Type | Default |
|---|---|---|
itemsTimeline entries in order. Each item needs year, background and foreground, plus optional index, title and description. Supports any item count. | TimelineItem[] | — |
scrollPerItemScroll distance devoted to each transition, in vh. Total track = viewport + distance × (items − 1). | number | 100 |
rotationAmountFinal counter-clockwise year rotation in degrees, around the bottom-left anchor. | number | 82 |
yearSizeCSS font-size for the oversized year. Kept at full size while panels collapse so the mask slices the type. | string | "clamp(9rem, 19vw, 20rem)" |
descriptionWidthCSS width for the upper-right description block. | string | "min(28rem, 30vw)" |
easingEasing applied to each transition's local progress. | "linear" | "smooth" | "smooth" |
viewportHeightHeight of the pinned viewport (any CSS length). | string | "100vh" |
smoothingScroll-follow smoothing 0 (direct scrub) to 1. Keep at 0 so the timeline literally is the scroll position. | number | 0 |
disableAnimationWhen true, renders a static accessible list instead of the pinned scroll effect. | boolean | false |
pauseWhenOffscreenPause transform work while the section is far offscreen (IntersectionObserver with 600px margin). | boolean | true |
Accessibility#
The section accepts ariaLabel, panels after the first are aria-hidden when inactive, and a polite live region announces the active year and title. Each panel includes sr-only full text while the oversized year is aria-hidden; there are no keyboard controls beyond native scrolling.
Motion#
Panels collapse horizontally via clip-path and the oversized year rotates around its bottom-left anchor as scroll progress changes; scrollPerItem, easing, rotationAmount, and smoothing tune it. prefers-reduced-motion or disableAnimation renders a static accessible list.
View source
Keep in mind
Need a custom component?
I build bespoke UI components & websites tailored to your brand.

