Tab Bar

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-tab-bar

About this component

A bottom navigation bar as a radio group. The chosen tab's pill widens to make room for its label, which slides out from behind the icon while the icon fills in with a little bounce; the previous tab folds back to just its outline icon. Pure CSS (the label width animates through grid 0fr to 1fr).

Triggers

  • Click
  • State change
  • Icon
  • Spring

Techniques

  • CSS transition
  • Keyframes
  • Spring

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

Real native radios (visually hidden: absolute, 1x1, opacity 0) inside <label>s in a role="radiogroup" with an aria-label, so arrow keys, focus and screen readers work.

Reduced motion

The changes are instant.

Use it in anything you build, commercial and client work included. Licence

More radios

See all
ThemeGet code
Tip JarGet code
TurntableGet code