Browse documentation

Toasts

Confirm brief results without interrupting the user's workflow.

Import

Load the optional component layer before using the examples below.

Ruby
require "zaniah/ui"

Variants

Use success, info, warning, or danger to match the message. A toast can be dismissed.

Rendered example
Success toast with a short saved message.
Rendered by Zaniah's headless backend.
Ruby
Zaniah::UI::Toast.new("Saved", variant: :success)

API summary

Constructor options and behaviors are drawn from the component reference.

ComponentConstructor and methodsVariants or behavior
Toast(message, variant:, queue:); dismissinfo/success/warning/danger

Accessibility

Toasts are live status messages. Put essential instructions somewhere persistent as well.

ComponentSemantic role
Toastlive status