# Alert

A message that stays on the page, with a tone, optional actions and a choice of how urgently screen readers hear it.

- **Use it for**: A persistent message about the page or form, with a tone and an action.
- **Not for**: Brief confirmations that should go away. Try [Toast](https://unseenui.com/components/toast/), [EmptyState](https://unseenui.com/components/empty-state/).

## Installation

```bash
npm install @stackunseen/ui
```

## Usage

```tsx
import { Alert } from '@stackunseen/ui';
import { AlertTitle, AlertDescription } from '@stackunseen/ui';
import '@stackunseen/ui/styles.css';

<Alert tone="info"><AlertTitle>Preview environment</AlertTitle><AlertDescription>Changes here affect the local example only.</AlertDescription></Alert>
```

## All props

| Prop | Type | Description |
| --- | --- | --- |
| `icon` | `ReactNode` | Decorative visual. |
| `tone` | `FeedbackTone` |  |

## Keyboard

The message is read in document order. Only nested actions enter the tab sequence.

## Works with

[Field](https://unseenui.com/components/field/), [Input](https://unseenui.com/components/input/), [Textarea](https://unseenui.com/components/textarea/), [Select](https://unseenui.com/components/select/), [Checkbox](https://unseenui.com/components/checkbox/), [Switch](https://unseenui.com/components/switch/), [Button](https://unseenui.com/components/button/), [EmptyState](https://unseenui.com/components/empty-state/), [Progress](https://unseenui.com/components/progress/), [Toast](https://unseenui.com/components/toast/), [LoadingIndicator](https://unseenui.com/components/loading-indicator/), [Skeleton](https://unseenui.com/components/skeleton/)

Page: https://unseenui.com/components/alert/
