Reaction

Reaction
No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-reaction

About this component

A reaction picker in a floating pill: Like, Love, Cheer and Insight. The one you pick fills with its own colour, its icon springs up in white and a ring of two-colour sparks bursts out round it once.

Triggers

  • Click
  • State change
  • Spring
  • Icon
  • Keyframe

Techniques

  • Pseudo elements
  • Keyframes
  • CSS variables
  • SVG
  • Radial gradient

Difficulty

Intermediate

Moves on

Its code uses this curve. Open one to see it plotted and tune it.

Accessibility

Keyboard and screen readers

Native radios in a fieldset with a visually hidden legend ("Reaction"), each in a <label> with its visible name (Like, Love, Cheer, Insight); the faces and sparks are aria-hidden. :focus-visible outlines the face.

Reduced motion

The pop, ring and sparks are switched off and the picked face is shown filled at once.

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

More radios

See all
Accent colour
RevolveGet code
Stage
RollGet code
Waveform
ScopeGet code
Billing period
SloshGet code