m3e/menu_item

menu_item provides Lustre support for the M3E Menu Item component

Types

MenuItem is an item of a menu

Fields:

  • disabled: Whether the element is disabled
  • link: Whether the element is a link
pub opaque type MenuItem

Slot gives type-safe names to each of the defined HTML named slots

pub type Slot {
  Icon
  TrailingIcon
}

Constructors

  • Icon
  • TrailingIcon

Values

pub fn disabled(m: MenuItem, disabled: Bool) -> MenuItem

disabled sets the disabled field

pub fn link(
  m: MenuItem,
  link: option.Option(link.Link),
) -> MenuItem

link sets the link field

Parameters:

  • m: a MenuItem
  • link: a Link
pub fn new() -> MenuItem

new creates a new MenuItem

pub fn render(
  m: MenuItem,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render creates a Lustre Element from a MenuItem

pub fn slot(s: Slot) -> attribute.Attribute(msg)

slot creates a Lustre ‘slot’ Attribute(msg) for a Slot

Search Document