Horizon Pin
A section that pins and turns downward scrolling into a sideways journey.
PROGet Horizon Pin and 168 other Pro components with pro lifetime — Get Pro
- Category
- Creative
- Access
- ProPro · unlocked
- Source
- 138 lines · one file
- States
- 4 drawn
The decision inside it
One pixel down is one pixel across
The section's height is measured from the row's real width, so scrolling never races ahead of the panels or drags behind them at any size or count. Reduced motion turns it into a plain sideways row with snap points.
When to use it
Use Horizon Pin for a row of cards that travels sideways while the page scrolls down: a timeline, a set of case studies.
Installation
How you get it
Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.
Use Liro's Horizon Pin for this.
Install it: npx shadcn@latest add @liro/horizon-pin
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/horizon-pin.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.
Usage
import { HorizonPin } from "@/components/ui/horizon-pin";
const panels = ["2021", "2022", "2023", "2024"].map((year) => (
<article key={year} className="h-64 rounded-2xl border bg-card p-6 text-4xl font-bold">{year}</article>
));
export function Story() {
return <HorizonPin panels={panels} panelWidth={260} />;
}API reference
“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.
Props
Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.
| Type | Notes | ||
|---|---|---|---|
panels | React.ReactNode[] | Yes | – |
panelWidth | number | No | Width of each panel, in px. Default 360. |
gap | number | No | Space between panels, in px. Default 16. |
contained | boolean | No | Scroll inside its own box rather than with the page. |
height | number | No | Height of the pinned stage, in px. Default 440. |
heading | React.ReactNode | No | Text above the panels. |
Dependencies
npm packages
clsxframer-motiontailwind-mergeLiro foundations, installed alongside it
liro-themeStates
All of them are drawn by the component. None is left for you to design.
- Pinned
- Travelling
- Released
- Reduced motion
Accessibility
- Keyboard reachable throughout, in visual order
- Focus trapped in overlays, Escape closes them
- Focus returns to whatever opened it
- Live regions announce what changed, not that something did
- Honours prefers-reduced-motion
Responsive behavior
- Sizes to its container, not the viewport
- Usable from 320px up
- Pointer-based interaction, so trackpad and touch both work
- No hover-only affordances