Alert
stableDisplays a callout for user attention.
Basic usage
Heads up!
You can edit this later.
Error
Something went wrong.
Examples
All variants
Five semantic variants to cover every notification context.
Deployed
v2.8.0 is live in production.
Approaching limit
Upgrade before the billing cycle ends.
Tip
Use keyboard shortcuts to move faster.
Alert variants
Use semantic variants for success, warning, info and destructive states.
Deployment complete
Production updated without errors.
Review required
Two checks need manual approval.
Payment failed
Update billing to avoid workspace suspension.
Filled alerts with color prop
Add filled and color props together for solid-background alert styles.
primary
This is a primary filled alert.
error
This is a error filled alert.
warning
This is a warning filled alert.
info
This is a info filled alert.
success
This is a success filled alert.
Features
- Five variants: default, destructive, success, warning, info.
Installation
bash
pnpm dlx structyl add alertAPI Reference
Alert.Root
The alert container. Has role="alert".
| Prop | Type | Default |
|---|---|---|
| variant | 'default' | 'destructive' | 'success' | 'warning' | 'info'Visual style. | 'default' |
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |
Alert.Title
The alert heading.
| Prop | Type | Default |
|---|---|---|
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |
Alert.Description
The alert body text.
| Prop | Type | Default |
|---|---|---|
| className | stringAdditional Tailwind classes, merged with the component defaults. | — |