> ## Documentation Index
> Fetch the complete documentation index at: https://prefab.prefect.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Alert

> Prominent messages for important information, warnings, and errors.

Alerts draw attention to important information. They pair a title with a description and use color variants to signal intent.

## Basic Usage

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Alert,
>     AlertTitle,
>     AlertDescription,
> )
>
> with Alert():
>     AlertTitle("Heads up!")
>     AlertDescription("You can add components to your app using the CLI.")
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "type": "Alert",
>     "variant": "default",
>     "children": [
>       {"type": "AlertTitle", "content": "Heads up!"},
>       {
>         "type": "AlertDescription",
>         "content": "You can add components to your app using the CLI."
>       }
>     ]
>   }
> }
> ```

## With Icons

Pass an `icon` prop to render a lucide icon alongside the alert content. The icon automatically aligns with the title and description.

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Alert,
>     AlertDescription,
>     AlertTitle,
>     Column,
> )
>
> with Column(gap=4):
>     with Alert(icon="circle-alert"):
>         AlertTitle("Heads up!")
>         AlertDescription(
>             "You can add components to your app "
>             "using the CLI."
>         )
>
>     with Alert(variant="destructive", icon="circle-x"):
>         AlertTitle("Error")
>         AlertDescription(
>             "Your session has expired. Please log "
>             "in again."
>         )
>
>     with Alert(variant="success", icon="circle-check"):
>         AlertTitle("Success")
>         AlertDescription(
>             "Your changes have been saved "
>             "successfully."
>         )
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "cssClass": "gap-4",
>     "type": "Column",
>     "children": [
>       {
>         "type": "Alert",
>         "variant": "default",
>         "icon": "circle-alert",
>         "children": [
>           {"type": "AlertTitle", "content": "Heads up!"},
>           {
>             "type": "AlertDescription",
>             "content": "You can add components to your app using the CLI."
>           }
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "destructive",
>         "icon": "circle-x",
>         "children": [
>           {"type": "AlertTitle", "content": "Error"},
>           {
>             "type": "AlertDescription",
>             "content": "Your session has expired. Please log in again."
>           }
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "success",
>         "icon": "circle-check",
>         "children": [
>           {"type": "AlertTitle", "content": "Success"},
>           {
>             "type": "AlertDescription",
>             "content": "Your changes have been saved successfully."
>           }
>         ]
>       }
>     ]
>   }
> }
> ```

## Variants

Five variants cover different semantic intents — from neutral information to success confirmations and error states.

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Alert,
>     AlertDescription,
>     AlertTitle,
>     Column,
> )
>
> with Column(gap=4):
>     with Alert():
>         AlertTitle("Default")
>         AlertDescription("A neutral informational message.")
>
>     with Alert(variant="destructive"):
>         AlertTitle("Error")
>         AlertDescription("Your session has expired. Please log in again.")
>
>     with Alert(variant="success"):
>         AlertTitle("Success")
>         AlertDescription("Your changes have been saved successfully.")
>
>     with Alert(variant="warning"):
>         AlertTitle("Warning")
>         AlertDescription("Your trial expires in 3 days.")
>
>     with Alert(variant="info"):
>         AlertTitle("Info")
>         AlertDescription("A new version is available for download.")
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "cssClass": "gap-4",
>     "type": "Column",
>     "children": [
>       {
>         "type": "Alert",
>         "variant": "default",
>         "children": [
>           {"type": "AlertTitle", "content": "Default"},
>           {"type": "AlertDescription", "content": "A neutral informational message."}
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "destructive",
>         "children": [
>           {"type": "AlertTitle", "content": "Error"},
>           {
>             "type": "AlertDescription",
>             "content": "Your session has expired. Please log in again."
>           }
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "success",
>         "children": [
>           {"type": "AlertTitle", "content": "Success"},
>           {
>             "type": "AlertDescription",
>             "content": "Your changes have been saved successfully."
>           }
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "warning",
>         "children": [
>           {"type": "AlertTitle", "content": "Warning"},
>           {"type": "AlertDescription", "content": "Your trial expires in 3 days."}
>         ]
>       },
>       {
>         "type": "Alert",
>         "variant": "info",
>         "children": [
>           {"type": "AlertTitle", "content": "Info"},
>           {
>             "type": "AlertDescription",
>             "content": "A new version is available for download."
>           }
>         ]
>       }
>     ]
>   }
> }
> ```

## Without Title

For simple messages, you can use just a description:

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Alert,
>     AlertDescription,
> )
>
> with Alert():
>     AlertDescription("Your changes have been saved.")
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "type": "Alert",
>     "variant": "default",
>     "children": [{"type": "AlertDescription", "content": "Your changes have been saved."}]
>   }
> }
> ```

## In Context

Alerts work well inside cards or at the top of a page to communicate status:

> [card]
>
> ```python Python icon="python" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> from prefab_ui.components import (
>     Card,
>     CardHeader,
>     CardTitle,
>     CardContent,
>     Alert,
>     AlertTitle,
>     AlertDescription,
>     Column,
> )
>
> with Card():
>     with CardHeader():
>         CardTitle("Deployment")
>     with CardContent():
>         with Column(gap=4):
>             with Alert():
>                 AlertTitle("Maintenance Window")
>                 AlertDescription("Deployments are paused from 2:00–4:00 AM UTC.")
>             with Alert():
>                 AlertTitle("Latest Deploy")
>                 AlertDescription("v2.1.0 deployed successfully 3 hours ago.")
> ```
>
> ```json Protocol icon="brackets-curly" theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
> {
>   "view": {
>     "type": "Card",
>     "children": [
>       {
>         "type": "CardHeader",
>         "children": [{"type": "CardTitle", "content": "Deployment"}]
>       },
>       {
>         "type": "CardContent",
>         "children": [
>           {
>             "cssClass": "gap-4",
>             "type": "Column",
>             "children": [
>               {
>                 "type": "Alert",
>                 "variant": "default",
>                 "children": [
>                   {"type": "AlertTitle", "content": "Maintenance Window"},
>                   {
>                     "type": "AlertDescription",
>                     "content": "Deployments are paused from 2:00\u20134:00 AM UTC."
>                   }
>                 ]
>               },
>               {
>                 "type": "Alert",
>                 "variant": "default",
>                 "children": [
>                   {"type": "AlertTitle", "content": "Latest Deploy"},
>                   {
>                     "type": "AlertDescription",
>                     "content": "v2.1.0 deployed successfully 3 hours ago."
>                   }
>                 ]
>               }
>             ]
>           }
>         ]
>       }
>     ]
>   }
> }
> ```

## API Reference

> [card] Alert Parameters
>
> **variant** `str` (default: default)
>
> Visual style: `"default"`, `"destructive"`, `"success"`, `"warning"`, `"info"`.
>
> **icon** `str | None` (default: None)
>
> Lucide icon name in kebab-case (e.g., `"circle-alert"`, `"circle-check"`). Browse icons at [lucide.dev/icons](https://lucide.dev/icons).
>
> **css\_class** `str | None` (default: None)
>
> Additional Tailwind CSS classes.

> [card] AlertTitle Parameters
>
> **content** `str` *required*
>
> Title text. Can be passed as a positional argument.
>
> **css\_class** `str | None` (default: None)
>
> Additional Tailwind CSS classes.

> [card] AlertDescription Parameters
>
> **content** `str` *required*
>
> Description text. Can be passed as a positional argument.
>
> **css\_class** `str | None` (default: None)
>
> Additional Tailwind CSS classes.

## Protocol Reference

```json Alert theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "type": "Alert",
  "id?": "string",
  "onMount?": "any",
  "children?": "[Component]",
  "let?": "object",
  "variant?": "default | destructive | success | warning | info | string",
  "icon?": "string",
  "cssClass?": "string"
}
```

```json AlertTitle theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "type": "AlertTitle",
  "id?": "string",
  "onMount?": "any",
  "content": "string (required)",
  "cssClass?": "string"
}
```

```json AlertDescription theme={"theme":{"light":"snazzy-light","dark":"dark-plus"}}
{
  "type": "AlertDescription",
  "id?": "string",
  "onMount?": "any",
  "content": "string (required)",
  "cssClass?": "string"
}
```

For the complete protocol schema, see [Alert](https://prefab.prefect.io/docs/protocol/alert.md), [AlertTitle](https://prefab.prefect.io/docs/protocol/alert-title.md), [AlertDescription](https://prefab.prefect.io/docs/protocol/alert-description.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.