API

API

The browser module exports createHoldToConfirm. The React package adds HoldToConfirmButton.

NameDescription
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-fillThe attribute set on the button while it is held, and the fill element that grows across it.
HoldToConfirmButtonThe React button around the same controller. It takes onConfirm and holdMs.