Alert
Display important messages with terminal styling and variant-based color coding.
Import
Usage
The Alert component displays important messages with solid single-line borders and variant-based color coding for different severity levels.
This is a default alert message.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | 'default' | 'success' | 'warning' | 'error' | 'info' | 'default' | Visual variant indicating alert severity |
| title | React.ReactNode | - | Optional title displayed in the alert header |
| children | React.ReactNode | - | Alert message content |
| dismissible | boolean | false | Whether to show a dismiss button |
| onDismiss | () => void | - | Callback when the alert is dismissed |
| className | string | - | Additional CSS class names |
Variants
Severity Variants
Default alert message
Success! Operation completed.
Warning: Please review before continuing.
Error: Something went wrong.
Info: Here is some useful information.
With Title
✓Success
Your changes have been saved successfully.
✗Error
Failed to connect to the server. Please try again.
⚠Warning
Your session will expire in 5 minutes.
Dismissible
✓Success
Click the X to dismiss this alert.
⚠Warning
This warning can also be dismissed.
✗Error
Errors can be dismissed too.