Alert
Inline messages in four semantic colors (info, success, warning, danger). Supports dismiss, action links, action buttons, and list content.
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
@alert.Alert(alert.Config{
Title: "Update Available",
Description: "A new version is available.",
Variant: alert.Info,
})Dismissible
Dismissible: true adds a close button that fades the alert out via an Alpine transition.
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
@alert.Alert(alert.Config{
Title: "Successfully Subscribed",
Description: "Welcome aboard!",
Variant: alert.Success,
Dismissible: true,
})With Link
Attach a Link config to render a trailing action link.
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
@alert.Alert(alert.Config{
Title: "Update Available",
Description: "A new version is available.",
Variant: alert.Info,
Link: &alert.LinkConfig{Label: "Details", Href: "#"},
})With List
Pass ListItems to render a bulleted list under the description.
Password is not strong
The password you entered does not meet the requirements. Make sure your password:
- has minimum 8 characters
- includes both upper and lower cases
- contains at least one number
Password Requirements
In order to keep your account secure, make sure your password:
- has minimum 8 characters
- includes both upper and lower cases
- contains at least one number
@alert.Alert(alert.Config{
Title: "Password Requirements",
Description: "Make sure your password:",
Variant: alert.Info,
ListItems: []string{
"has minimum 8 characters",
"includes both upper and lower cases",
"contains at least one number",
},
})With Action Buttons
Attach an Action config for primary + dismiss buttons.
Update Available
A new version is available. Please update to the latest version.
Successfully Subscribed
Success! You've subscribed to our newsletter. Welcome aboard!
Credit Card Expires Soon
Your credit card expires soon. Please update your payment information.
Invalid Email Address
The email address you entered is invalid. Please try again.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
Title | string | "" | Alert heading. |
Description | string | "" | Alert body text. |
Variant | Variant | Info | Color: "info", "success", "warning", "danger". |
Dismissible | bool | false | Add a close button with a fade transition. |
Link | *LinkConfig | nil | Trailing action link (Text + Href). |
Action | *ActionConfig | nil | Primary + dismiss action buttons. |
ListItems | []string | nil | Bulleted list rendered under the description. |
RootClass | string | "" | Extra classes on the alert. |