Preview
Props
Variants
One quick doubt
Pass a single confirmation for a lightweight "are you sure?" gate.
Maximum dread
A longer chain for the truly irreversible.
Install
npx shadcn@latest add @evilbuttons/doubt-buttonUsage
import { DoubtButton } from "@/components/evil-buttons/doubt-button";
export function ButtonDemo() {
return (
<DoubtButton
label="Delete everything"
successLabel="Too late."
onConfirm={() => wipeDatabase()}
/>
);
}Props
The component spreads any <button> HTML attributes except onClick.
| Prop | Type | Default | Description |
|---|---|---|---|
children | React.ReactNode | - | Label shown in the idle state. Falls back to label. |
label | React.ReactNode | "Delete everything" | Idle label used when no children are provided. |
confirmations | React.ReactNode[] | 6 escalating prompts | Prompts shown one per click; the last one fires the action. |
successLabel | React.ReactNode | "Too late." | Label flashed after the final confirmation. |
onConfirm | () => void | - | Fired only after the last confirmation is clicked. |
resetAfter | number | 1600 | Milliseconds to stay in the success state before resetting. Set to 0 to stay. |
className | string | - | Extra classes passed to the button. |
Good to know
- Needs
confirmations.length + 1clicks beforeonConfirm. - An empty
confirmationsarray makes it a normal button.