Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Timeline

ProNew

A scroll-following timeline with left/right lists, pinned-rail snap scrolling, horizontal carousel, slider and image stories. Entries accept a cover, expandable description and supplied action.

Installation

pnpm dlx shadcn@latest add @viewport/timeline

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

<Timeline>

PropTypeDefault
children*React.ReactNode

`TimelineItem` elements.

—
layoutTimelineLayout

The existing vertical layout remains the default. Horizontal modes page on touch or by arrow keys.

"list-right"
markerStyleTimelineMarker"point"
labelstring

Heading for the focusable horizontal scroller.

"Timeline"
autoScrollnumber

Optional horizontal autoplay interval, in milliseconds. Pauses on hover/focus and under reduced motion.

—
classNamestring—

<TimelineItem>

PropTypeDefault
title*string—
metastring

Small line above the title, usually a date or a version.

—
image{ src: string; alt: string }

Optional cover image for the event.

—
summarystring

A short description before a visitor expands the full body in `children`.

—
action{ label: string; href?: string; onClick?: () => void }

Per-event link or consumer-supplied action.

—
markerReact.ReactNode

Marker content, such as an icon; `number` markers count events automatically.

—
as"h2" | "h3" | "h4"

Heading element for the title, to fit your page outline.

—
childrenReact.ReactNode—
classNamestring—

Accessibility

  • Every layout is an ordered list with real headings; choose the level with `as`.
  • Horizontal tracks scroll by touch, buttons or Left/Right/Home/End; snap lists scroll by Up/Down/Page/Home/End.
  • Autoplay pauses under the pointer, on focus and under reduced motion. Vertical rails and entries show at full contrast when motion is reduced.
  • Expandable descriptions report `aria-expanded`, and actions are native links or buttons.