m3e/chip

Chip is a non-interactive chip used to convey small pieces of information.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Chip is a View Model for this component

Fields:

  • value: A string representing the value of the chip.
  • variant: The appearance variant of the chip.
pub opaque type Chip

Config is a public record for configuring this component.

pub type Config {
  Config(value: String, variant: chip_variant.ChipVariant)
}

Constructors

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

pub type Slot {
  Icon
  TrailingIcon
}

Constructors

  • Icon
  • TrailingIcon

Values

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_value: String
pub fn from_config(config: Config) -> Chip

from_config creates a new Chip from the given configuration.

pub fn new() -> Chip

new creates a new Chip with the default configuration.

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

render creates a Lustre Element for a Chip

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

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

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

pub fn value(record: Chip, value: String) -> Chip

value sets the value of value for this Chip.

pub fn variant(
  record: Chip,
  variant: chip_variant.ChipVariant,
) -> Chip

variant sets the value of variant for this Chip.

Search Document