# m3e/tree_item

TreeItem is an expandable item in a tree.

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,
        indeterminate: Indeterminate,
        open: Open,
        selected: Selected,
      )
    }

### Constructors

-     Config(
        disabled: Disabled,
        indeterminate: Indeterminate,
        open: Open,
        selected: Selected,
      )

## Disabled

</>

Disabled is whether the element is disabled.

    pub type Disabled {
      IsDisabled
      IsNotDisabled
    }

### Constructors

-     IsDisabled

-     IsNotDisabled

## Indeterminate

</>

Indeterminate is a value indicating whether the element’s selected / checked state is indeterminate.

    pub type Indeterminate {
      IsIndeterminate
      IsNotIndeterminate
    }

### Constructors

-     IsIndeterminate

-     IsNotIndeterminate

## Open

</>

Open is whether the item is expanded.

    pub type Open {
      IsOpen
      IsNotOpen
    }

### Constructors

-     IsOpen

-     IsNotOpen

## Selected

</>

Selected is whether the item 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 {
      Label
      Icon
      SelectedIcon
      ToggleIcon
      OpenToggleIcon
    }

### Constructors

-     Label

-     Icon

-     SelectedIcon

-     ToggleIcon

-     OpenToggleIcon

## TreeItem

opaque </>

TreeItem is a View Model for this component

## Fields:

- disabled: Whether the element is disabled.
- indeterminate: A value indicating whether the element’s selected / checked state is indeterminate.
- open: Whether the item is expanded.
- selected: Whether the item is selected.

    pub opaque type TreeItem

# 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_indeterminate

</>

    pub const default_indeterminate: Indeterminate

## default_open

</>

    pub const default_open: Open

## default_selected

</>

    pub const default_selected: Selected

## disabled

</>

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

disabled sets the value of disabled for this TreeItem.

## from_config

</>

    pub fn from_config(config: Config) -> TreeItem

from_config creates a new TreeItem from the given configuration.

## indeterminate

</>

    pub fn indeterminate(
      record: TreeItem,
      indeterminate: Indeterminate,
    ) -> TreeItem

indeterminate sets the value of indeterminate for this TreeItem.

## new

</>

    pub fn new() -> TreeItem

new creates a new TreeItem with the default configuration.

## open

</>

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

open sets the value of open for this TreeItem.

## render

</>

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

render creates a Lustre Element for a TreeItem

## 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 TreeItem Config

## selected

</>

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

selected sets the value of selected for this TreeItem.

## slot

</>

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

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

✨