npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-destructive-button.json --yesDestructive button
ProThe button for an action that deletes or cannot be undone, marked in the danger colour, for React and Tailwind CSS. Part of Goop Pro.
What an agent sees
import { DestructiveButton } from '@/components/ui/goop/destructive-button';
function DeleteVisit({ onDelete }: { onDelete: () => void }) {
return (
<div className="flex gap-2">
<DestructiveButton>Delete visit</DestructiveButton>
<DestructiveButton hold icon="trash" onConfirm={onDelete}>
Delete visit
</DestructiveButton>
</div>
);
}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
- Pair it with AlertDialog to confirm.
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.
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/meadow-destructive-button.json --yesAdd the Goop Destructive button to this project. The install steps are at https://goop.so/docs/install.mdUsage
import { DestructiveButton } from '@/components/ui/goop/destructive-button';
function DeleteVisit({ onDelete }: { onDelete: () => void }) {
return (
<div className="flex gap-2">
<DestructiveButton>Delete visit</DestructiveButton>
<DestructiveButton hold icon="trash" onConfirm={onDelete}>
Delete visit
</DestructiveButton>
</div>
);
}- Also known as: Button variant="destructive".
- height, width, gap, corner, background, motion: add no class for these.
API reference
| Option | Type | What it does |
|---|---|---|
| icon? | IconName = 'alert-circle' | A pack icon name, one whose shape says the action; left out, the circled bang (alert-circle). |
| hold? | boolean = false | Confirm by a press held down (the pointer, Space or Enter), with no dialog: a darker veil runs across the button and onConfirm runs once it is full; released early, nothing runs. |
| onConfirm? | () => void | With hold, the action: run once the hold reaches its end, or on the second step's press. |
| onFinished? | () => void | With 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? | number | With 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 (default "Hold to confirm"). |
| confirmLabel? | string | With 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
| Key | What it does |
|---|---|
| Enter | Activate |
| Space | Activate |
Accessibility
- The part itself answers the keys above.
- hover, active, focus-visible: the browser's own (:hover, :active, :focus-visible): write nothing
Motion
- The part sets its own motion: add no transition or animation of your own.
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.