A flexible scroll-driven timeline with animated progress, configurable orientations, customizable pins, and optional external scroll-container control.
Made by raouf.codesOverview
Core Concept
The Timeline component provides a scroll-driven timeline experience with support for both horizontal and vertical orientations. Built with Framer Motion's scroll-linked animations, it features animated progress bars, customizable pins, and smooth transitions.
Key Features
- Scroll-driven progress — Progress bar animates based on scroll position
- Responsive orientation — Automatically switches to vertical on mobile
- Animated pins — Scale and opacity transitions as items enter viewport
- Sticky viewport — Horizontal mode keeps timeline fixed during scroll
- RTL support — Full right-to-left layout via the
directionprop - External scroll source — Drive timeline animation from a separate scrolling container via
containerScrollRef
Anatomy
Timeline— Root component (orientation resolver)Timeline.Item— Individual timeline entry with title and contentTimeline.Header— Optional header block for the timeline
By default, Timeline automatically switches to vertical layout on mobile screens.
Installation
Usage
Basic
Vertical Orientation
Separate Components
Use dedicated components when you want an explicit layout regardless of viewport:
Composition with an External Scroll Container
Use containerScrollRef when a parent container should control timeline progress (for example, inside a scrollable panel).
With Header
Variant Examples
Size Variants
Gradient Variants
Visual Styles
Pin Shapes
Mobile Behavior
Timeline switches from horizontal to vertical on mobile by default. You can disable this behavior with responsive={false}.
Direction (LTR / RTL)
Use the direction prop to control reading direction:
API Reference
Timeline
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | - |
orientation? | enum | "horizontal" |
responsive? | boolean | true |
mobileBreakpoint? | number | 1024 |
containerScrollRef? | React.RefObject<HTMLElement | null> | - |
intent? | enum | "primary" |
size? | enum | "md" |
gradient? | enum | "purple-blue" |
visuals? | enum | "none" |
shape? | enum | "circle" |
direction? | enum | "ltr" |
aria-label? | string | "Timeline" |
className? | string | - |
progressClassName? | string | - |
Timeline.Header
| Prop | Type | Default |
|---|---|---|
children | React.ReactNode | - |
orientation? | enum | - |
direction? | enum | - |
className? | string | - |
Timeline.Item
| Prop | Type | Default |
|---|---|---|
title | string | - |
children | React.ReactNode | - |
orientation? | enum | - |
intent? | enum | - |
size? | enum | - |
direction? | enum | - |
visuals? | enum | - |
shape? | enum | - |
className? | string | - |
contentClassName? | string | - |
pinClassName? | string | - |
aria-current? | enum | - |
Accessibility
The Timeline component includes the following accessibility features:
- Semantic HTML with
<section>,role="list", androle="listitem" - Proper heading hierarchy with
aria-labelledbyrelationships - Progress indicators are decorative and hidden from screen readers
- Scroll-driven animations respect
prefers-reduced-motion
Credits
- Inspired by horizontal scroll timelines and scroll-driven animation patterns.
Built by raouf.codes. The source code is available on GitHub.
Last updated: 5/2/2026