Alert
A contextual feedback message for important information, warnings, errors, and success states.
ARIA: role="alert"Feedback
Information
A new software update is available.
Success
Your profile has been updated.
Warning
Your trial expires in 3 days.
Error
Failed to save changes. Please try again.
alert.rs
use stratum_leptos::*;
view! {
<Alert variant=AlertVariant::Info>
"A new software update is available."
</Alert>
<Alert variant=AlertVariant::Error>
"Failed to save changes."
</Alert>
}Installation
stratum add alertProps
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | AlertVariant | Info | Style: Info, Success, Warning, Error |
| title | Option<String> | None | Optional title text |
Accessibility
- Renders with
role="alert"for error/warning variants. - Info and success use
role="status".