Alert
Displays a callout for user attention. Use composition parts, or pass title / description for the progressive prop API.
Usage
Payment successful
Your payment of $29.99 has been processed. A receipt has been sent to your email address.
Composition
code
Alert
├── Icon (optional SVG)
├── AlertTitle
├── AlertDescription
└── AlertAction
Prefer the prop API for typical callouts. Compose manually when you need custom markup:
New feature available
We've added dark mode support. You can enable it in your account settings.
Destructive
Use variant="destructive" for error-style callouts.
Payment failed
Your payment could not be processed. Please check your payment method and try again.
Status variants
Slate also ships success, warning, and info using the semantic theme tokens.
Synced
Your workspace finished syncing.
Quota almost full
You have used 90% of your plan.
Tip
You can invite teammates from Settings.
Action
Pass an action slot for a button in the top-end corner.
Dark mode is now available
Enable it under your profile settings to get started.
API Reference
Alert
| Prop | Type | Default | Description |
|---|---|---|---|
variant |
default | destructive | success | warning | info |
default |
Visual tone |
title |
string |
— | Compose alert-title automatically |
description |
string |
— | Compose alert-description automatically |
as |
string |
div |
Root HTML element |
Named slot: action → wraps content in alert-action.
Parts
alert-title, alert-description, and alert-action accept as and any HTML attributes.