Skip to content

Alert

Displays a callout for user attention.

Install

Bash
npx @madeui/cli add alert

Usage

TSX
import { Alert, AlertAction, AlertDescription, AlertTitle } from '@/components/ui/alert';

<Alert>
  <AlertTitle>Heads up!</AlertTitle>
  <AlertDescription>...</AlertDescription>
</Alert>

Composition

TSX
<Alert>
  <AlertTitle />
  <AlertDescription />
  <AlertAction />
</Alert>

Destructive

Action

AlertAction pins a slot (typically a button) to the top-right corner.

API reference

Alert

PropTypeDefaultDescription
variant'default' | 'destructive''default'Visual style.
styleStyleXStyles—StyleX styles merged last — always win over the component’s own styles.

Styling

AlertTitle, AlertDescription, AlertAction accept style (StyleXStyles, merged last so caller overrides always win) plus all native props of the element they render.

Was this page helpful?