# 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

opaque </>

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

</>

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

## default_config

</>

    pub fn default_config() -> Config

default_config is the default configuration for this component.

## default_for

</>

    pub const default_for: option.Option(String)

## default_position

</>

    pub const default_position: badge_position.BadgePosition

## default_size

</>

    pub const default_size: badge_size.BadgeSize

## for

</>

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

for sets the value of for for this Badge.

## from_config

</>

    pub fn from_config(config: Config) -> Badge

from_config creates a new Badge from the given configuration.

## new

</>

    pub fn new() -> Badge

new creates a new Badge with the default configuration.

## position

</>

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

position sets the value of position for this Badge.

## render

</>

    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

## render_config

</>

    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

## size

</>

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

size sets the value of size for this Badge.

✨