ui/toolbar
Types
Keyboard messages for toolbar component.
pub type Msg {
MoveNext
MovePrev
MoveFirst
MoveLast
Activate
}
Constructors
-
MoveNextMove to next toolbar item (ArrowRight or ArrowDown)
-
MovePrevMove to previous toolbar item (ArrowLeft or ArrowUp)
-
MoveFirstMove to first toolbar item (Home)
-
MoveLastMove to last toolbar item (End)
-
ActivateActivate the currently focused item (Enter or Space)
Toolbar orientation for keyboard navigation.
pub type Orientation {
Horizontal
Vertical
}
Constructors
-
Horizontal -
Vertical
Values
pub fn aria_label(label: String) -> attribute.Attribute(a)
pub fn keymap(key_event: keyboard.KeyEvent) -> option.Option(Msg)
Keymap for toolbar keyboard navigation. Follows WAI-ARIA toolbar pattern:
- ArrowRight/ArrowDown: Move to next toolbar item
- ArrowLeft/ArrowUp: Move to previous toolbar item
- Home: Move to first toolbar item
- End: Move to last toolbar item
- Enter/Space: Activate the currently focused item
pub fn orientation(o: Orientation) -> attribute.Attribute(a)
Set toolbar orientation.
pub fn size(s: Size) -> attribute.Attribute(a)
pub fn toolbar(
attributes: List(attribute.Attribute(a)),
children: List(element.Element(a)),
) -> element.Element(a)
pub fn toolbar_item_element_id(index: Int) -> String
Get the element ID for a toolbar item at the given index.
pub fn variant(v: Variant) -> attribute.Attribute(a)