lustre/ui/button

Functions

pub fn button(
  attributes: List(Attribute(a)),
  children: List(Element(a)),
) -> Element(a)

A styled native HTML button. You can use the solid, soft, and outline attributes to configure the button’s appearance.

pub fn clear() -> Attribute(a)
pub fn error() -> Attribute(a)
pub fn greyscale() -> Attribute(a)
pub fn info() -> Attribute(a)
pub fn of(
  element: fn(List(Attribute(a)), List(Element(a))) -> Element(a),
  attributes: List(Attribute(a)),
  children: List(Element(a)),
) -> Element(a)

Use this function if you want to render something other than a <button /> element. It will automatically have the role and tabindex attributes set.

🚨 To make your non-standard buttons accessible, it is important that you handle click events as well as key events for the Enter and Space.

pub fn outline() -> Attribute(a)
pub fn primary() -> Attribute(a)
pub fn small() -> Attribute(a)
pub fn soft() -> Attribute(a)
pub fn solid() -> Attribute(a)
pub fn success() -> Attribute(a)
pub fn warning() -> Attribute(a)
Search Document