04.36 · Micro-Interactions
Hold to Confirm
A button fills up while you hold it and acts only once it is full. Best for delete buttons.
Click it
Press and hold the button until it fills (or hold Space or Enter on it), or press Show me.
Old drafts
The marker follows the fill along the top bar, and only its end deletes. Hold the button and let go early, or press Show me: it runs back, from full in the lower bar's time.
Deletes on tap: one slip and the drafts are gone. Hold to confirm: a short press only starts the fill, which drains back, and it deletes once full; press the button or Show me.
Try it
Change a setting, then try it again or press Show me.
How long to hold
How long the button must be held before it acts.
Fill style
A bar fills the button; a ring fills around a round button.
A small shake says the hold was too short.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add hold to confirm to [the button for a risky action, such as Delete]. While the visitor holds it down, a fill grows steadily, and the action runs only once it is full, when a tick shows. If they let go early, the fill drains back, nothing happens and a short hint says to keep holding; when the settings ask for it, the button also shakes. Holding Space or Enter works the same way, and on touch a long press must not open the browser's menu. Grow the fill smoothly by the time held, not per frame, and announce the result to screen readers. If the visitor has reduced motion turned on, fill in a few steps without the shake. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.