Tip Jar

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/radio-tip-jar

About this component

A tip picker with a jar. Choosing 10, 15, 20 or 25% drops that many coins into the jar one after another, each tumbling in and landing on the pile with a little bounce; picking less sends the extras back up out of the top. The amount updates underneath. Pure CSS.

Triggers

  • Click
  • State change
  • Delay stagger
  • Spring

Techniques

  • CSS variables
  • Transition delay stagger
  • CSS transition

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
TurntableGet code
CardGet code