howdy/ui/navigation_menu

Navigation menus: a site’s main links, some opening a panel of further links.

navigation_menu.menu([attribute.aria_label("Main")], [
  navigation_menu.link("/", active: True, children: [text("Home")]),
  navigation_menu.panel("products", label: [text("Products")], links: [
    navigation_menu.panel_link("/analytics", title: "Analytics", description: "See what your customers do."),
    navigation_menu.panel_link("/billing", title: "Billing", description: "Invoices and payments."),
  ]),
])

A panel opens from its button below the bar, and closes with Escape or a click elsewhere; its links are ordinary links in the tab order.

Values

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

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

pub fn link(
  href: String,
  active active: Bool,
  children children: List(element.Element(msg)),
) -> element.Element(msg)

A link in the bar. active marks the page being shown.

pub fn list_class() -> css.Class
pub fn menu(
  attributes: List(attribute.Attribute(msg)),
  items: List(element.Element(msg)),
) -> element.Element(msg)
pub fn panel(
  id: String,
  label label: List(element.Element(msg)),
  links links: List(element.Element(msg)),
) -> element.Element(msg)

A button in the bar that opens a panel of links.

pub fn panel_class() -> css.Class
pub fn panel_description_class() -> css.Class
pub fn panel_link(
  href: String,
  title title: String,
  description description: String,
) -> element.Element(msg)

A link in a panel, with a line saying where it goes.

pub fn panel_link_class() -> css.Class
pub fn panel_list_class() -> css.Class
pub fn panel_title_class() -> css.Class
pub fn trigger_class() -> css.Class
✨ Search Document