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 alert

Props

PropTypeDefaultDescription
variantAlertVariantInfoStyle: Info, Success, Warning, Error
titleOption<String>NoneOptional title text

Accessibility

  • Renders with role="alert" for error/warning variants.
  • Info and success use role="status".