Skip to content
TrademarkTrademark
Docs
Components

ConfirmButton

Updated: November 8, 2026
View on GitHub

One press of a ConfirmButton never acts. In the default "twice" mode the first press arms it: the label asks for a second press, the button turns armedTone (danger by default) and a bar runs down the time left. A second press within timeout runs onConfirm. Escape, moving focus away or the time running out disarms it, and a double click's second press is ignored, so a double click never confirms by accident.

Reach for it where a dialog would be too slow and one press too easy: a manual trip, stopping a deploy, deleting a row in a dense table.

Hold

mode="hold" fills the button while it is held, by pointer or by Space or Enter, and acts when it is full (holdDuration, 1.5 s by default). Letting go early cancels.

Accessibility

Every change is in words: the label changes as the button arms or fills, and a status line tells a screen reader how to confirm or cancel. The bar and the colour only repeat what the label says.

API reference

Type
Default
onConfirmrequired
() => void—
mode
twicehold
twice
labels
Partial<ConfirmButtonLabels>—
timeout
number4000
holdDuration
number1500
armed
boolean—
defaultArmed
booleanfalse
onArmedChange
(armed: boolean) => void—
armedTone
ButtonProps["tone"]danger
…and every LeafProps propinherited—
Edit this page on GitHub