howdy/ui/menubar

Menubars: a row of menus, as at the top of a desktop application.

menubar.menubar([attribute.aria_label("Editor")], [
  menubar.menu_button("file-menu", [text("File")]),
  menubar.menu_button("edit-menu", [text("Edit")]),
]),
menu.menu("file-menu", [], [menu.item([], [text("New")]), menu.item([], [text("Open…")])]),
menu.menu("edit-menu", [], [menu.item([], [text("Undo")])]),

The menus are howdy/ui/menu menus. Left and right move between the buttons, and between open menus; down opens one. Once a menu is open, pointing at another button opens that one instead.

Values

pub fn button_class() -> css.Class
pub fn classes() -> List(css.Class)

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

pub fn menu_button(
  id: String,
  children: List(element.Element(msg)),
) -> element.Element(msg)

A button in the menubar that opens the menu with this id.

pub fn menubar(
  attributes: List(attribute.Attribute(msg)),
  buttons: List(element.Element(msg)),
) -> element.Element(msg)
pub fn menubar_class() -> css.Class
✨ Search Document