Layout

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-layout

About this component

A view switcher (grid, list, feature) whose preview actually rearranges: the four tiles glide and resize into the new layout one after another with a springy settle, so you see what you are choosing. Pure CSS (each layout is a set of positions picked with :has()).

Triggers

  • Click
  • State change
  • Spring
  • Delay stagger

Techniques

  • Transition delay stagger
  • CSS transition
  • 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. Each radio is labelled (Grid, List, Feature); the icons are aria-hidden.

Reduced motion

The changes are instant.

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

More radios

See all
MoodGet code
SeatGet code
ShapeGet code
SizesGet code