Files
Danny WhiteandJoshen Lim 11dc1324aa chore(studio): improve alert composition and usage (#41147)
* finesse optical alignment

* improvements

* actions styling

* improvements

* margins

* improvements

* fix docs

* fix

* improve schema warning admonition

* misc fixes

* tweaks

* docs and improvements

* alphabetical sidebar navigation

* remove alert-error

* fix build error

* Tiny fixes

* tiny docs update

* semantic description

* handle intro pages

* note NoPermission component

* docs sidebar ordering

---------

Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
2025-12-10 08:05:30 +00:00

38 lines
822 B
Plaintext

---
title: Alert
description: Displays a callout for user attention.
component: true
source:
radix: true
shadcn: true
---
Alert forms the core primitives for [Admonition](../fragments/admonition). Use the Admonition component unless you must deviate from our consistent patterns. Examples where Alert might make sense include:
- Bespoke icon requirement
- Highly custom internal contents
<ComponentPreview name="alert-demo" peekCode wide />
## Installation
```bash
npx shadcn-ui@latest add alert
```
## Usage
```tsx
import { Alert, AlertDescription, AlertTitle } from '@/components/ui/alert'
```
```tsx
<Alert>
<Terminal className="h-4 w-4" />
<AlertTitle>Heads up!</AlertTitle>
<AlertDescription>
You can add components and dependencies to your app using the cli.
</AlertDescription>
</Alert>
```