m3e/badge

Badge is a visual indicator used to label content.

This file was generated by m3e/generator

     DO NOT EDIT

Types

Badge is a View Model for this component

Fields:

  • size: The size of the badge.
  • position: The position of the badge, when attached to another element.
  • for: The identifier of the interactive control to which this element is attached.
pub opaque type Badge

Config is a public record for configuring this component.

pub type Config {
  Config(
    size: badge_size.BadgeSize,
    position: badge_position.BadgePosition,
    for: option.Option(String),
  )
}

Constructors

Values

pub fn default_config() -> Config

default_config is the default configuration for this component.

pub const default_for: option.Option(String)
pub fn for(record: Badge, for: option.Option(String)) -> Badge

for sets the value of for for this Badge.

pub fn from_config(config: Config) -> Badge

from_config creates a new Badge from the given configuration.

pub fn new() -> Badge

new creates a new Badge with the default configuration.

pub fn position(
  record: Badge,
  position: badge_position.BadgePosition,
) -> Badge

position sets the value of position for this Badge.

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

render creates a Lustre Element for a Badge

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

pub fn size(record: Badge, size: badge_size.BadgeSize) -> Badge

size sets the value of size for this Badge.

Search Document