ui/toolbar

Types

Keyboard messages for toolbar component.

pub type Msg {
  MoveNext
  MovePrev
  MoveFirst
  MoveLast
  Activate
}

Constructors

  • MoveNext

    Move to next toolbar item (ArrowRight or ArrowDown)

  • MovePrev

    Move to previous toolbar item (ArrowLeft or ArrowUp)

  • MoveFirst

    Move to first toolbar item (Home)

  • MoveLast

    Move to last toolbar item (End)

  • Activate

    Activate the currently focused item (Enter or Space)

Toolbar orientation for keyboard navigation.

pub type Orientation {
  Horizontal
  Vertical
}

Constructors

  • Horizontal
  • Vertical
pub type Size {
  Small
  Medium
  Large
}

Constructors

  • Small
  • Medium
  • Large
pub type Variant {
  Default
  Muted
}

Constructors

  • Default
  • Muted

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.

Search Document