m3e/expandable_list_item

expandable_list_item provides Lustre support for the M3E Expandable List Item component

Types

Config is the configuration of an ExpandableListItem

pub type Config {
  Config(disabled: Bool, open: Bool)
}

Constructors

  • Config(disabled: Bool, open: Bool)

ExpandableListItem provides a hierarchical navigation structure that allows users to expand and collapse content sections

Fields:

  • disabled: Whether the element is disabled
  • open: Whether the item is expanded
pub opaque type ExpandableListItem

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

pub type Slot {
  Items
  Leading
  Overline
  SupportingText
  ToggleIcon
  Trailing
}

Constructors

  • Items
  • Leading
  • Overline
  • SupportingText
  • ToggleIcon
  • Trailing

Values

pub fn default_config() -> Config

default_config creates a Config with default values

pub fn disabled(
  e: ExpandableListItem,
  disabled: Bool,
) -> ExpandableListItem

disabled sets the disabled field

pub fn from_config(config: Config) -> ExpandableListItem

from_config creates an ExpandableListItem from a Config

Parameters:

  • config: a Config
pub fn new() -> ExpandableListItem

new creates an ExpandableListItem with default values

pub fn open(
  e: ExpandableListItem,
  open: Bool,
) -> ExpandableListItem

open sets the open field

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

render creates a Lustre Element from an ExpandableListItem

Parameters:

  • e: an ExpandableListItem
  • attributes: a list of additional Attributes
  • children: the main content
pub fn render_config(
  config: Config,
  attributes: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

render_config creates a Lustre Element directly from a Config

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

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

Search Document