# m3e/nav_item

NavItem is an item, placed in a navigation bar or rail, used to navigate to destinations in an application.

This file was generated: By: m3e/generator version 0.1.0 At: 2026-05-05T14:38:23+10:00

         DO NOT EDIT

# Types

## Config

</>

Config is a public record for configuring this component.

    pub type Config {
      Config(
        disabled: Disabled,
        disabled_interactive: DisabledInteractive,
        download: option.Option(String),
        href: String,
        orientation: nav_item_orientation.NavItemOrientation,
        rel: String,
        selected: Selected,
        target: option.Option(link_target.LinkTarget),
      )
    }

### Constructors

-     Config(
        disabled: Disabled,
        disabled_interactive: DisabledInteractive,
        download: option.Option(String),
        href: String,
        orientation: nav_item_orientation.NavItemOrientation,
        rel: String,
        selected: Selected,
        target: option.Option(link_target.LinkTarget),
      )

## Disabled

</>

Disabled is a value indicating whether the element is disabled.

    pub type Disabled {
      IsDisabled
      IsNotDisabled
    }

### Constructors

-     IsDisabled

-     IsNotDisabled

## DisabledInteractive

</>

DisabledInteractive is a value indicating whether the element is disabled and interactive.

    pub type DisabledInteractive {
      IsDisabledInteractive
      IsNotDisabledInteractive
    }

### Constructors

-     IsDisabledInteractive

-     IsNotDisabledInteractive

## NavItem

opaque </>

NavItem is a View Model for this component

## Fields:

- disabled: A value indicating whether the element is disabled.
- disabled_interactive: A value indicating whether the element is disabled and interactive.
- download: A value indicating 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.
- orientation: The layout orientation of the item.
- rel: The relationship between the `target` of the link button and the document.
- selected: A value indicating whether the element is selected.
- target: The target of the link button.

    pub opaque type NavItem

## Selected

</>

Selected is a value indicating whether the element is selected.

    pub type Selected {
      IsSelected
      IsNotSelected
    }

### Constructors

-     IsSelected

-     IsNotSelected

## Slot

</>

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

    pub type Slot {
      Icon
      SelectedIcon
    }

### Constructors

-     Icon

-     SelectedIcon

# Values

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_disabled

</>

    pub const default_disabled: Disabled

## default_disabled_interactive

</>

    pub const default_disabled_interactive: DisabledInteractive

## default_download

</>

    pub const default_download: option.Option(String)

## default_href

</>

    pub const default_href: String

## default_orientation

</>

    pub const default_orientation: nav_item_orientation.NavItemOrientation

## default_rel

</>

    pub const default_rel: String

## default_selected

</>

    pub const default_selected: Selected

## default_target

</>

    pub const default_target: option.Option(link_target.LinkTarget)

## disabled

</>

    pub fn disabled(record: NavItem, disabled: Disabled) -> NavItem

disabled sets the value of disabled for this NavItem.

## disabled_interactive

</>

    pub fn disabled_interactive(
      record: NavItem,
      disabled_interactive: DisabledInteractive,
    ) -> NavItem

disabled_interactive sets the value of disabled_interactive for this NavItem.

## download

</>

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

download sets the value of download for this NavItem.

## from_config

</>

    pub fn from_config(config: Config) -> NavItem

from_config creates a new NavItem from the given configuration.

## href

</>

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

href sets the value of href for this NavItem.

## new

</>

    pub fn new() -> NavItem

new creates a new NavItem with the default configuration.

## orientation

</>

    pub fn orientation(
      record: NavItem,
      orientation: nav_item_orientation.NavItemOrientation,
    ) -> NavItem

orientation sets the value of orientation for this NavItem.

## rel

</>

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

rel sets the value of rel for this NavItem.

## render

</>

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

render creates a Lustre Element for a NavItem

## render_config

</>

    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 NavItem Config

## selected

</>

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

selected sets the value of selected for this NavItem.

## slot

</>

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

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

## target

</>

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

target sets the value of target for this NavItem.

✨