Skip to content
Onycx-ui
ESC

Horizontal Rail

Move a row of cards sideways as the page scrolls. A native horizontal scroller is available as a fallback.

Dependencies
gsap
Size
303 lines
Controls
9 controls

Installation

CLI · shadcn registry

npx shadcn@latest add https://ui.onycx.dev/r/horizontal-rail.json

1 · Dependencies

npm install gsap

2 · Copy the source

components/onycx/horizontal-rail.tsx

Requires React 19 and Tailwind CSS v4. Copy the source from the horizontal-rail.tsx tab after tweaking: your values are baked in as the new defaults. Exported image examples use portable sample artwork. Replace it with your own media as needed.

Props

PropTypeDefaultDescription
itemsRailItem[]—{ title, family?, tagline?, image, imageAlt?, href? }. Cards become links when href is set.
index / eyebrowstring"II" / "The Signatures"Caps label with a gold rule.
heading / headingAccentstring"A feeling," / "before a name."Serif heading with a gold italic tail.
introstring—Header paragraph; "\n" breaks a line.
hintstring"Scroll through the collection"Caps label under the rail. Empty hides it.
offset / scrubnumber0 / 0.8Pin position below a fixed header (px) and scroll smoothing.
turnbooleanfalseAdds the per-card 3D turn while pinned.
gold / ivory / backgroundstring"#c8ae80" / "#f3ebdd" / "#0e0d0c"Accent, text and section colours.
classNamestring—Extra classes on the section.