Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-destructive-button.json --yes

Destructive button

Pro

The button for an action that deletes or cannot be undone, marked in the danger colour, for React and Tailwind CSS. Part of Goop Pro.

Switch the shape, the size and the icon; change the words; disable it. Press it and the count goes up, never while disabled; in the pair, Cancel sets the count back. With Hold, hold it down to the end (or press it twice by a screen reader): the line under it says the delete was confirmed. Look puts it alone, on a card, or after Cancel. Nothing is deleted: the press, or the finished hold, only counts. A real delete asks first (see the alert dialog).

When to use

  • The button for an action that deletes or cannot be undone, marked in the danger colour.

When not to use

Installation

Paste the prompt below into your coding agent. It reads Goop's install steps, installs the part and its tokens once, then reuses this same Destructive button on every screen instead of drawing a new one: the same height, the same focus ring, the same spacing. As a Pro part, its command comes from Goop's server once you sign in, with a one-time link that lasts ten minutes.

Terminal
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-destructive-button.json --yes
PROMPT
Add the Goop Destructive button to this project. The install steps are at https://goop.so/docs/install.md

Usage

TSX
import { DestructiveButton } from '@/components/ui/goop/destructive-button';

function DeleteNote({ onDelete }: { onDelete: () => void }) {
  return (
    <div className="flex gap-2">
      <DestructiveButton>Delete note</DestructiveButton>
      <DestructiveButton hold icon="trash" onConfirm={onDelete}>
        Delete note
      </DestructiveButton>
    </div>
  );
}
  • Fits: schedule, settings (their recipes).
  • Also known as: Button variant="destructive".
  • height, width, corner, background, motion: add no class for these.

API reference

Options
OptionTypeWhat it does
icon?IconName = 'alert-circle'A pack icon name, one whose shape says the action; left out, the circled bang the theme's destructive alert draws.
hold?boolean = falseConfirm by a press held down (the pointer, Space or Enter), with no dialog: a soft red fill runs across the button and onConfirm runs once it is full; released early, nothing runs.
onConfirm?() => voidWith hold, the action: run once the hold reaches its end, or on the second step's press.
onFinished?() => voidWith hold, run once the finish after onConfirm (the tick and confirmedLabel, a second) is over and the button is back at rest: close a panel round it there, so the finish is seen.
holdDuration?numberWith hold, how long the press is held to confirm, ms (default 1200).
holdHint?string = 'Hold to confirm'With hold, the button's description, said on a short press too.
confirmLabel?stringWith hold, the words the button shows, and the status says, after a click with no press behind it (a screen reader's): a second press within four seconds confirms.
confirmedLabel?string = 'Confirmed'With hold, the words the button shows, and the status says once, for a second after a hold held to the end, beside the pack's tick (default "Confirmed").
type?'button' | 'submit' | 'reset'
onClick?(event: MouseEvent) => void
disabled?boolean
  • Takes every prop of Button but variant and asChild (its page: button.md)

Keyboard

KeyWhat it does
EnterActivate
SpaceActivate

Accessibility

  • The part itself answers the keys above.
  • hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing

Its states are drawn from attributes and props, so assistive technology and your agent read the same thing:

StateDrawn by
disabledthe prop disabled

Motion

  • The part sets its own motion: add no transition or animation of your own.
  • How the theme moves, and how to move your own parts the same way: Motion.

Notes for AI

Give your coding agent this page as text instead of screenshots: the parts, the options, the states and the keys. An agent that reads the real part builds the real part, not a lookalike.

goop.so/themes/trail/components/destructive-button.md · the page as Markdown
Theme
Install with your agentnpx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-destructive-button.json --yes

Where would you like to start?

Free · now

The Goop plugin

A design system for your AI coding agent, so screen ten matches screen one.

/plugin marketplace add goop-so/skillsthen /plugin install goop@goopCodex, Cursor, ChatGPT, the Claude app and more: Connect Goop
FreePro

The components

Every part live, with its props, its keys and what an agent sees. Whole page and app templates, working with sample data.