Alert

An inline callout in a pane: a tinted box with a symbol, a title and a description.

@cupertinoui/alertRegistry JSON

Installation

pnpm dlx shadcn@latest add @cupertinoui/alert

The first install also adds the macOS theme. See Installation to set up the registry.

Usage

import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"

<Alert>
  <InfoIcon />
  <AlertTitle>iCloud Drive is syncing</AlertTitle>
  <AlertDescription>1,204 items left.</AlertDescription>
</Alert>

API Reference

Every part forwards the props of the underlying element. The props below are the ones CupertinoUI adds or changes.

Alert

PropTypeDescription
variant"default" | "warning" | "destructive"
Default: "default"
Blue, yellow or red.
classNamestringExtra classes, merged with the component's own.

AlertTitle / AlertDescription / AlertAction

PropTypeDescription
classNamestringExtra classes, merged with the component's own.