m3e/button_group

button group provides Lustre support for the M3E Button Group component

Types

Button Group component arranges multiple into a unified, expressive layout

pub opaque type ButtonGroup

Config allows for a declarative configuration of the ButtonGroup

pub type Config {
  Config(
    multi: config.SelectionMode,
    size: option.Option(config.Size),
    variant: option.Option(Variant),
  )
}

Constructors

Variant is the appearance variant of the group

pub type Variant {
  Connected
  Standard
}

Constructors

  • Connected
  • Standard

Values

pub fn default_config() -> Config

default_config returns a default Config

pub const default_variant: Variant
pub fn from_config(c: Config) -> ButtonGroup

from_config creates a ButtonGroup from a Config

pub fn multi(
  bg: ButtonGroup,
  multi: config.SelectionMode,
) -> ButtonGroup

multi sets the multi field

pub fn new() -> ButtonGroup

new creates a new ButtonGroup

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

render creates a Lustre Element from a Button Group

Parameters:

  • bg: a ButtonGroup
  • attributes: a list of additional Attributes
  • children: a list of child Elements
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 Config

pub fn size(
  bg: ButtonGroup,
  size: option.Option(config.Size),
) -> ButtonGroup

size sets the size field

pub fn variant(
  bg: ButtonGroup,
  variant: option.Option(Variant),
) -> ButtonGroup

variant sets the variant field

Search Document