howdy/ui/alert

Alerts: a message that stands out from the content around it.

alert.alert(alert.Danger, [], [
  alert.title([text("Payment failed")]),
  alert.description([text("Your card was declined.")]),
])

An svg icon placed first sits to the left of the title and description.

When an alert appears in response to something the user did, such as a live view reporting an error, pass attribute.role("alert") so a screen reader announces it. A message that is part of the page from the start needs no role.

Types

pub type Variant {
  Info
  Danger
}

Constructors

  • Info

    Information, in the text colour.

  • Danger

    A problem, in the danger colour.

Values

pub fn alert(
  variant: Variant,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn alert_class(variant: Variant) -> css.Class
pub fn classes() -> List(css.Class)

Every class this module uses, for howdy/ui/export.

pub fn description(
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn description_class() -> css.Class
pub fn title(
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn title_class() -> css.Class
✨ Search Document