---
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>/meadow-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, AlertAction, AlertDescription, AlertIcon, AlertTitle } from '@/components/ui/goop/alert';
import { Button } from '@/components/ui/goop/button';

function SyncPaused({ onRetry }: { onRetry: () => void }) {
  return (
    <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" onClick={onRetry}>
          Retry
        </Button>
      </AlertAction>
    </Alert>
  );
}
```

- Fits: account, states (their recipes).
- In the page, at the top of the section or above the form it concerns: an `AlertIcon` (left empty: the kind's own), an `AlertTitle` of a few words, an `AlertDescription` that says what to do, and at most one `AlertAction` holding the theme's `Button size="sm"` or its `Link`. A notice about the whole page is the `Banner`; the result of something the person just did is a `Toast`.
- height, gap, text: 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, centred on the title's 18 px line; 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/meadow/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/meadow/components/button): A button with words that runs an action, in several looks and sizes, on a page, in a row or in a sidebar.
- [Banner](/themes/meadow/components/banner): A full-width accent pill that announces one thing, such as an app to install or a feature to switch on, with one action at its end.
- [Progress](/themes/meadow/components/progress): A bar that fills as work goes on, for an upload or a setup with a known end, or that sweeps while the end is unknown.
