Alert
Displays a callout for user attention.
Examples
Regular
Preview
Update complete
Your account was synchronized successfully. No further action is required.
Emphasis
Preview
Update complete
Your account was synchronized successfully. No further action is required.
Success
Preview
Payment Success
The selected card was declined. Try again using a different payment method.
Warning
Preview
Payment Attention
The selected card was declined. Try again using a different payment method.
Error
Preview
Payment failed
The selected card was declined. Try again using a different payment method.
Inline without description
Preview
Update complete
With close button
Preview
Update complete
Your account was synchronized successfully. No further action is required.
With actions
Preview
Unsaved changes
You have unsaved changes that will be lost if you leave this page.
With close button and actions
Preview
Payment failed
The selected card was declined. Try again using a different payment method.
API
Alert
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| variant | ”regular” | “emphasis” | “success” | “warning” | “error" | "regular”, “emphasis”, “success”, “warning”, “error" | "regular” | Sets the semantic style for the alert. |
| onClose | () => void | - | - | Callback function called when the close button is clicked. Shows close button when provided. |
| className | string | - | - | Additional CSS classes for the container. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertTitle
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| className | string | - | - | Additional CSS classes for the title. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertContainer
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| className | string | - | - | Additional CSS classes for the container. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertIcon
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| icon | React.ReactNode | - | - | The icon to be displayed in the alert. |
| className | string | - | - | Additional CSS classes for the icon container. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertContent
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| className | string | - | - | Additional CSS classes for the content wrapper. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| className | string | - | - | Additional CSS classes for the description. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertActions
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| className | string | - | - | Additional CSS classes for the actions container. |
| …props | All native div props | - | - | Allows passing any other standard div properties. |
AlertButton
The AlertButton automatically inherits the variant from its parent Alert component, so you don’t need to manually specify the alert variant.
| Property | Type | Possible values | Default | Description |
|---|---|---|---|---|
| variant | ”regular” | “basic" | "regular”, “basic" | "regular” | Sets the visual style of the button. Regular has background color, basic is text only with hover effect. Automatically inherits the alert variant from the parent Alert. |
| className | string | - | - | Additional CSS classes for the button. |
| …props | All native button props | - | - | Allows passing any other standard button properties. |
Last updated on