---
agent:
  instructions: "Search goop.so for Goop's components, templates, design skill, docs, pricing and terms. Ask in keywords or a plain question, such as \"date picker props\" or \"is the design skill free\"; the answer is the matching page sections in Markdown, each with its address."
  endpoint: "https://goop.so/.well-known/search?q={query}"
  method: "GET"
  documentation: "https://developers.cloudflare.com/ai-search/how-to/search-for-agents/"
---

# Alert

A message about the state of something that stays inline in the page until it changes, for React and Tailwind CSS. Part of Goop Pro.

Pro. Its export: `Alert`.

## Try it

Switch the kind (its icon and colour follow), retitle it, make its description long or take it away (the title alone), take its action away; the Retry action counts its presses.

Retry reaches nothing: it only counts.

## When to use

- A message about the state of something that stays inline in the page until it changes.
- Also called: callout or notice.

## When not to use

- For a passing notice use Toast.

## 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 Alert 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.

```sh
npx shadcn@4.23.1 add https://registry.goop.so/g/<link>/trail-alert.json --yes
```

```text
Add the Goop Alert to this project. The install steps are at https://goop.so/docs/install.md
```

## Usage

```tsx
import { Alert, AlertIcon, AlertTitle, AlertDescription, AlertAction } from '@/components/ui/goop/alert';
import { Button } from '@/components/ui/goop/button';

<Alert variant="warning">
  <AlertIcon />
  <AlertTitle>Sync paused</AlertTitle>
  <AlertDescription>Changes are kept on this device until the connection is back.</AlertDescription>
  <AlertAction>
    <Button size="sm">Retry</Button>
  </AlertAction>
</Alert>
```

- Fits: account, states (their recipes).
- height, width: add no class for these.

## API reference

### Options

- `variant: default | info | success | warning | destructive = default`

### Parts

- `AlertIcon` — The kind's pack icon in its 16 px box, at the start of the row; icon?: IconName — A pack icon name in place of the kind's
- `AlertTitle` — The alert's few words
- `AlertDescription` — The message under the title
- `AlertAction` — The caller's action at the end of the row (the theme's small `Button`, or its `Link`)

- Class recipes (cva): alertVariants (Alert)
- data-slot values (to select a part by): alert, alert-action, alert-content, alert-description, alert-icon, alert-title

## 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.

## Related

- [Toast](/themes/trail/components/toast): A short notice at a corner of the app that confirms an action and goes by itself, with an optional action such as Undo.
- [Button](/themes/trail/components/button): A button with words that runs an action, in several looks and sizes.
- [Banner](/themes/trail/components/banner): A full-width band across the top of the app or a page for one message that stays until it is no longer true, such as a trial ending.
- [Progress](/themes/trail/components/progress): A bar for work under way, its amount known or not.
