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 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
.