API
API
The browser module exports createHoldToConfirm. The React package adds HoldToConfirmButton.
| Name | Description |
|---|---|
createHoldToConfirm(button, { onConfirm, holdMs? }) | Turns a button into a hold. onConfirm runs once the hold completes. holdMs is 1200 by default. |
cancel(), destroy() | Stops a hold in progress, or removes the hold and restores the button. |
data-holding, reuse-hold-fill | The attribute set on the button while it is held, and the fill element that grows across it. |
HoldToConfirmButton | The React button around the same controller. It takes onConfirm and holdMs. |