Bounds

Aspect ratio
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-bounds

About this component

An aspect ratio picker in design-tool style: three outlined tiles, each with a dashed frame in its own proportion. The one you pick gets a blue selection box with corner handles, and its frame runs with marching ants.

Triggers

  • Click
  • State change
  • Border
  • Loop

Techniques

  • SVG
  • stroke-dashoffset
  • Keyframes
  • CSS transition

Difficulty

Intermediate

Accessibility

Keyboard and screen readers

Native radios in a fieldset with a visually hidden legend ("Aspect ratio"), each in a <label> and named by aria-label ("Square 1:1", "Wide 16:9", "Tall 9:16"); the drawings and ratio text are aria-hidden. The focused tile is outlined.

Reduced motion

The ants stop and the handles appear at once.

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

More radios

See all
Input
BrassGet code
Candle
CandlesGet code
Rating
ChalkGet code
Plan
ChoiceGet code