Alert
Feedback
@rockshin/tao-uiDisplays important contextual feedback messages with semantic status types.
When to use
Use Alert for persistent, page-level feedback about a state or operation. Use Sonner toasts for transient notifications.
Recommended
- Pick the semantic type that matches the severity of the message.
- Keep the title short; put detail in the description.
- Enable showIcon when the alert needs to be scannable at a glance.
Avoid
- Do not stack many alerts in one view; prefer a single summary.
- Do not use Alert for transient feedback; use a toast instead.
Examples
Basic usage
Changes saved
New version available
Refresh when you are ready.
Subscription expires soon
Could not save changes
Descriptions and icons
Deployment complete
Production is running version 0.0.25.
Update available
Refresh when you are ready.
Quota almost reached
Storage is 92% full.
Build failed
Fix the type errors and run again.
Closable alerts and actions
Closable message
Payment method expires soon
Update it before the next billing date.
Connection lost
Title and description
Use description for the cause and recovery while keeping the title concise.
Success
Your changes have been saved successfully.
Info
A new version is available. Refresh to update.
Warning
Your subscription expires in 3 days.
Error
Something went wrong while processing your request.
Status icons
showIcon adds the matching success, information, warning, or error icon.
Success
Info
Warning
Error
Success
Icons grow larger when a description is present.
🔥
Custom Icon
Inline actions
Use action for an operation related to the message and provide feedback when it completes.
New version available
Request failed
These actions update local example state.