Hold to Confirm

No dependencies
Code format

Install with shadcn

Needs a free account token. Get a token

npx shadcn@latest add @movin/button-hold-confirm

About this component

Hold the mouse button down to fill a circular SVG progress ring. Progress is driven by requestAnimationFrame over a 1.5-second duration. Releasing early resets to zero. When the ring completes, the button enters a confirmed state with a checkmark and colour change for 1.8 seconds.

Triggers

  • Click
  • State change

Techniques

  • SVG
  • requestAnimationFrame
  • stroke-dashoffset

Difficulty

Advanced

Accessibility

Reduced motion

SVG ring animation still runs under prefers-reduced-motion as it is user-controlled, not decorative.

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

More buttons

See all
Ink StampGet code
Jello WobbleGet code
Loading LockGet code