Hold to confirm

Core

Confirm a destructive action by holding, not tapping.

pnpm dlx shadcn@latest add https://wui.alann.works/r/hold-to-confirm.json
Press and hold for 1.2 seconds to confirm. With a keyboard, hold Space or Enter.

API Reference

PropTypeDefault
label*stringrequired
confirmedLabelstring—
onConfirm*() => voidrequired
durationnumber—
iconReactNode—
tone"accent" | "danger" | "neutral"—
confirmedboolean—
onHoldChange(holding: boolean) => void—
Categories
actions
Dependencies
lucide-reactmotion