# Alert

> A highlighted message with title, description and icon.

- Category: [Actions & feedback](https://tarve.dev/docs.md#actions)
- Import: `import { Alert } from "@tarve/core";`
- Props type: `AlertProps`
- Source: [packages/core/src/form-controls.ts:26](https://github.com/omarcosr/tarve/blob/main/packages/core/src/form-controls.ts#L26)

## Usage

```tsx title="Alert.tsx"
import { Alert, Icon } from "@tarve/core";

<Alert
  style={{ width: 380 }}
  variant="destructive"
  icon={<Icon name="info" />}
  title="Your session expired"
  description="Sign in again to continue."
/>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `description` | `string` | — |  |
| `icon` | `Child` | — |  |
| `title` | `string` | — |  |
| `variant` | `AlertVariant` | `"default"` |  |

## Common props

Shared by every component (descriptions: https://tarve.dev/docs.md#common-props): `children`, `class`, `className`, `highlight`, `id`, `key`, `motionFrom`, `onHighlight`, `onPaste`, `onPointerLeave`, `onPointerMove`, `onSize`, `onTransitionEnd`, `rovingGroup`, `style`.

## Types

```ts title="AlertVariant"
type AlertVariant = "default" | "destructive" | "success";
```

Previous: [Skeleton](https://tarve.dev/docs/components/Skeleton.md) · Next: [Toast](https://tarve.dev/docs/components/Toast.md)

---

Tarve v0.13.8 · HTML version: https://tarve.dev/docs/components/Alert · Index for agents: https://tarve.dev/llms.txt
