m3e/icon
Icon is a small symbol used to easily identify an action or category.
This file was generated by m3e/generator
DO NOT EDIT
Types
Config is a public record for configuring this component.
pub type Config {
Config(
filled: Filled,
grade: icon_grade.IconGrade,
optical_size: Float,
name: String,
variant: icon_variant.IconVariant,
weight: icon_weight.IconWeight,
)
}
Constructors
-
Config( filled: Filled, grade: icon_grade.IconGrade, optical_size: Float, name: String, variant: icon_variant.IconVariant, weight: icon_weight.IconWeight, )
Filled is whether the icon is filled.
pub type Filled {
IsFilled
IsNotFilled
}
Constructors
-
IsFilled -
IsNotFilled
Icon is a View Model for this component
Fields:
- filled: Whether the icon is filled.
- grade: The grade of the icon.
- optical_size: A value from 20 to 48 indicating the optical size of the icon.
- name: The name of the icon.
- variant: The appearance variant of the icon.
- weight: A value from 100 to 700 indicating the weight of the icon.
pub opaque type Icon
Values
pub fn default_config() -> Config
default_config is the default configuration for this component.
pub const default_filled: Filled
pub const default_grade: icon_grade.IconGrade
pub const default_name: String
pub const default_optical_size: Float
pub const default_variant: icon_variant.IconVariant
pub const default_weight: icon_weight.IconWeight
pub fn from_config(config: Config) -> Icon
from_config creates a new Icon from the given configuration.
pub fn grade(record: Icon, grade: icon_grade.IconGrade) -> Icon
grade sets the value of grade for this Icon.
pub fn optical_size(record: Icon, optical_size: Float) -> Icon
optical_size sets the value of optical_size for this Icon.
pub fn render(
model: Icon,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render creates a Lustre Element for a Icon
pub fn render_config(
c: Config,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element from a Icon Config
pub fn variant(
record: Icon,
variant: icon_variant.IconVariant,
) -> Icon
variant sets the value of variant for this Icon.
pub fn weight(
record: Icon,
weight: icon_weight.IconWeight,
) -> Icon
weight sets the value of weight for this Icon.