DoubtButton

Get this button for GPUI

An escalating-confirmation button that makes you click through increasingly absurd, guilt-tripping prompts before the real action finally fires.

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-button

Usage

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.

PropTypeDefaultDescription
childrenReact.ReactNode-Label shown in the idle state. Falls back to label.
labelReact.ReactNode"Delete everything"Idle label used when no children are provided.
confirmationsReact.ReactNode[]6 escalating promptsPrompts shown one per click; the last one fires the action.
successLabelReact.ReactNode"Too late."Label flashed after the final confirmation.
onConfirm() => void-Fired only after the last confirmation is clicked.
resetAfternumber1600Milliseconds to stay in the success state before resetting. Set to 0 to stay.
classNamestring-Extra classes passed to the button.

Good to know

  • Needs confirmations.length + 1 clicks before onConfirm.
  • An empty confirmations array makes it a normal button.

Search docs

Jump to a button documentation page