m3e/badge
Badge is a visual indicator used to label content.
This file was generated: By: m3e/generator version 0.1.0 At: 2026-05-05T14:38:23+10:00
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
-
Config( size: badge_size.BadgeSize, position: badge_position.BadgePosition, for: option.Option(String), )
Values
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_for: option.Option(String)
pub const default_position: badge_position.BadgePosition
pub const default_size: badge_size.BadgeSize
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 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.