Rail
Markup where the component goes, CSS in your stylesheet, script before </body>. In Vue, Svelte or Angular, call initTabsRail(el) on the mounted element instead.
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/tab-railAbout this component
A knurled metal rail with the names cut along it and a slab of teal glass riding on top. Choose a name and the glass slides over to it on a spring; the name beneath turns teal and reads larger through the tint, as if magnified by the glass.
Triggers
- Click
- State change
- Spring
Techniques
- CSS transition
- CSS variables
- Gradient
- Pseudo elements
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
A WAI-ARIA tablist (aria-label "Range") of buttons with role="tab", aria-selected and aria-controls, a roving tabindex, arrow keys plus Home and End, and one tabpanel per tab; the groove and the glass are aria-hidden.
Reduced motion
The glass jumps to the name.
Use it in anything you build, commercial and client work included. Licence