››alert
Alert
A short message in neutral, info, success, warning or error, with an optional icon, title, description and an action such as dismiss.
Parts
| Part | File | Does |
|---|---|---|
| Alert | Alert.vue | Shows a short message to the shopper, with an optional icon, title and description. |
| AlertAction | AlertAction.vue | Holds a button or link that lets the user act on or dismiss the alert. |
| AlertDescription | AlertDescription.vue | Shows the detail text of the alert below its title. |
| AlertTitle | AlertTitle.vue | Shows the headline of the alert. |
Anatomy
<Alert>
<AlertTitle />
<AlertDescription />
<AlertAction />
</Alert>Styling
All of Alert’s styles live in alert.json. New to styling in Frontic UI? How styling works →
Install
- npm packages
- @lucide/vue
- class-variance-authority
- reka-ui
API reference
Shows a short message to the shopper, with an optional icon, title and description. Renders a <div>.
Props 3
| Prop | Type | Default | |
|---|---|---|---|
| class | ClassValue | — | |
| |||
| variant | AlertVariant | 'neutral' | |
| |||
| icon | boolean | true | |
| |||
Slots 1
| Slot | Slot props | |
|---|---|---|
| icon | — | |
| ||
Data attributes 1
| Data attribute | Values | |
|---|---|---|
| data-variant | 'neutral' | 'info' | 'success' | 'warning' | 'error' | |
| ||
Recipe alert 5 groups
backgroundColor colors.card#ffffff
textColor colors.card-foreground#09090b
border border.default1px solid #e4e4e7
borderColor colors.border#e4e4e7
rounded rounded.none0px
typography typography.small400 0.875rem/1.43 'Inter Variable', Inter, sans-serif
gap spacing.10.25rem
paddingX spacing.41rem
paddingY spacing.30.75rem
display grid
width full
justifyContent start
textAlign start
icon › size spacing.41rem
borderStart :afterborder.focus2px solid #71717a
borderColor :aftercolors.foreground#09090b
borderColor :aftercolors.info#2563eb
borderColor :aftercolors.positive#12883e
borderColor :aftercolors.warning#d97706
borderColor :aftercolors.destructive#c70009
Alert