Rail

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/tab-rail

About 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

More tabs

See all

TideGet code
BatikGet code
ContourGet code
DripGet code