m3e/badge
badge provides Lustre support for the M3E Badge component
Types
Badge is a compact visual indicator for counts, presence, or emphasis that can be attached to icons, buttons, or other components
Fields:
- for: the identifier of the interactive control to which this element is attached
- label: the text content of the badge
- size: the size of the badge
- badge_position: the position of the badge, when attached to another element
pub opaque type Badge
BadgePosition is the position of the badge, when attached to another element
pub type BadgePosition {
Above
AboveAfter
AboveBefore
After
Before
Below
BelowAfter
BelowBefore
}
Constructors
-
Above -
AboveAfter -
AboveBefore -
After -
Before -
Below -
BelowAfter -
BelowBefore
Config holds the configuration for a Badge
pub type Config {
Config(
for: option.Option(String),
label: String,
size: config.Size,
badge_position: BadgePosition,
)
}
Constructors
-
Config( for: option.Option(String), label: String, size: config.Size, badge_position: BadgePosition, )
Values
pub fn badge_position(
b: Badge,
badge_position: BadgePosition,
) -> Badge
badge_position sets the badge_position field
pub const default_badge_position: BadgePosition
pub fn default_config() -> Config
default_config creates a new Config with default values
pub fn render(b: Badge) -> element.Element(msg)
render creates a Lustre Element from a Badge
pub fn render_config(config: Config) -> element.Element(msg)
render_config creates a Lustre Element directly from a Config