Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
New feature available
We've added dark mode support. You can enable it in your account settings.
Installation
Section titled “Installation”pnpm dlx shadcn@latest add pxl-ui/registry/alert
Install the following dependencies:
pnpm add @base-ui/react
Copy and paste the following code into your project.
Update the import paths to match your project setup.
import { Alert, AlertAction, AlertDescription, AlertTitle,} from "@/components/ui/pxl/alert"<Alert> <InfoIcon /> <AlertTitle>Heads up!</AlertTitle> <AlertDescription> You can add components and dependencies to your app using the cli. </AlertDescription> <AlertAction> <Button variant="outline">Enable</Button> </AlertAction></Alert>Composition
Section titled “Composition”Use the following composition to build an Alert:
Alert├── Icon├── AlertTitle├── AlertDescription└── AlertActionAlert vs Callout
Section titled “Alert vs Callout”Use the Callout if you need to display admonitions/callouts for example from Markdown sources. Use the Alert component if you need deeper control or advanced customization.
Action
Section titled “Action”Use AlertAction to add a button or other action element to the alert.
Dark mode is now available
Enable it under your profile settings to get started.
Border
Section titled “Border”Use the border prop to change the border of the alert.
None
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Rounded
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Solid
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Variants
Section titled “Variants”Use the variant prop to change the colors of the alert.
New feature available
We've added dark mode support. You can enable it in your account settings.
Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
API Reference
Section titled “API Reference”The Alert component displays a callout for user attention.
| Prop | Type | Default |
|---|---|---|
variant |
"default" | "destructive" |
"default" |
AlertTitle
Section titled “AlertTitle”The AlertTitle component displays the title of the alert.
| Prop | Type | Default |
|---|---|---|
className |
string |
- |
AlertDescription
Section titled “AlertDescription”The AlertDescription component displays the description or content of the alert.
| Prop | Type | Default |
|---|---|---|
className |
string |
- |
AlertAction
Section titled “AlertAction”The AlertAction component displays an action element (like a button) positioned absolutely in the top-right corner of the alert.
| Prop | Type | Default |
|---|---|---|
className |
string |
- |