Overview
Hold to confirm
A button that acts only after a full press. Let go early and nothing happens.
Remove this draft?
Release early to cancelPrinciples
Confirm once per hold. A completed hold calls onConfirm exactly once, and the next action needs a new press.
Cancel on any doubt. Letting go early, leaving the button, blur, Escape or disabling the button cancels the hold.
Accept pointer and keys. A pointer, Space or Enter can hold, and keyboard auto-repeat never starts a new hold.
Let assistive technology click. A click without a physical press, as from a screen reader, confirms at once.
Own the gesture, not the action. Your code owns the request, the loading state, success and failure.
Keep the native button. It enhances a button you already have and restores its markup on destroy.