Browse documentation
Alerts
Show a persistent message that needs the user's attention.
Import
Load the optional component layer before using the examples below.
Ruby
require "zaniah/ui"Example
Choose the variant that matches the message. An alert remains visible until dismissed or replaced by the application.
Rendered example

Ruby
Zaniah::UI::Alert.new(
"Export complete",
message: "Your file is ready",
variant: :success,
dismissible: true
)
Live announcements
Set live: true only when a new message should be announced by assistive technology.
API summary
Constructor options and behaviors are drawn from the component reference.
| Component | Constructor and methods | Variants or behavior |
|---|---|---|
Alert | (title, message:, variant:, action:, dismissible:, live:); dismiss | info/success/warning/danger; persistent until dismissed |
Accessibility
A live alert uses the alert role; otherwise the message is exposed as status.
| Component | Semantic role |
|---|---|
Alert | alert when live, otherwise status |