Preset

Station preset
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-preset

About this component

Car radio preset keys, the thing radio buttons are named after: five ivory keys in a dark chrome-trimmed housing. Pressing one latches it down, lights its amber lamp and pops the last one back up.

Triggers

  • Click
  • State change
  • Glow

Techniques

  • CSS transition
  • Pseudo elements
  • Gradient

Difficulty

Beginner

Accessibility

Keyboard and screen readers

Native radios in a fieldset with a visually hidden legend ("Station preset"), each in a <label> and named by aria-label ("Preset 1" to "Preset 5"); the numbers on the caps are aria-hidden. Arrow keys move between them as usual and :focus-visible outlines the cap.

Reduced motion

The transitions are switched off and the key jumps to its latched state.

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

More radios

See all
Priority
PriorityGet code
Size
PuffyGet code
Ribbon
RibbonsGet code
Paper size
RisoGet code