m3e/nav_menu_item

NavMenuItem is an expandable item, selectable item within a navigation menu.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Config is a public record for configuring this component.

pub type Config {
  Config(
    disabled: Disabled,
    download: option.Option(String),
    href: String,
    open: Open,
    rel: String,
    selected: Selected,
    target: option.Option(link_target.LinkTarget),
  )
}

Constructors

Disabled is whether the element is disabled.

pub type Disabled {
  IsDisabled
  IsNotDisabled
}

Constructors

  • IsDisabled
  • IsNotDisabled

NavMenuItem is a View Model for this component

Fields:

  • disabled: Whether the element is disabled.
  • download: Whether the target of the link button will be downloaded, optionally specifying the new name of the file.
  • href: The URL to which the link button points.
  • open: Whether the item is expanded.
  • rel: The relationship between the target of the link button and the document.
  • selected: Whether the item is selected.
  • target: The target of the link button.
pub opaque type NavMenuItem

Open is whether the item is expanded.

pub type Open {
  IsOpen
  IsNotOpen
}

Constructors

  • IsOpen
  • IsNotOpen

Selected is whether the item is selected.

pub type Selected {
  IsSelected
  IsNotSelected
}

Constructors

  • IsSelected
  • IsNotSelected

Slots are used in child elements to insert content into this component

pub type Slot {
  Label
  Icon
  Badge
  SelectedIcon
  ToggleIcon
}

Constructors

  • Label
  • Icon
  • Badge
  • SelectedIcon
  • ToggleIcon

Values

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_disabled: Disabled
pub const default_download: option.Option(String)
pub const default_href: String
pub const default_open: Open
pub const default_rel: String
pub const default_selected: Selected
pub fn disabled(
  record: NavMenuItem,
  disabled: Disabled,
) -> NavMenuItem

disabled sets the value of disabled for this NavMenuItem.

pub fn download(
  record: NavMenuItem,
  download: option.Option(String),
) -> NavMenuItem

download sets the value of download for this NavMenuItem.

pub fn from_config(config: Config) -> NavMenuItem

from_config creates a new NavMenuItem from the given configuration.

pub fn href(record: NavMenuItem, href: String) -> NavMenuItem

href sets the value of href for this NavMenuItem.

pub fn new() -> NavMenuItem

new creates a new NavMenuItem with the default configuration.

pub fn open(record: NavMenuItem, open: Open) -> NavMenuItem

open sets the value of open for this NavMenuItem.

pub fn rel(record: NavMenuItem, rel: String) -> NavMenuItem

rel sets the value of rel for this NavMenuItem.

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

render creates a Lustre Element for a NavMenuItem

pub fn render_config(
  c: Config,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render_config creates a Lustre Element from a NavMenuItem Config

pub fn selected(
  record: NavMenuItem,
  selected: Selected,
) -> NavMenuItem

selected sets the value of selected for this NavMenuItem.

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

slot returns a Lustre Attribute(msg) for the given slot name

pub fn target(
  record: NavMenuItem,
  target: option.Option(link_target.LinkTarget),
) -> NavMenuItem

target sets the value of target for this NavMenuItem.

✨ Search Document