m3e/heading
heading provides Lustre support for the M3E Heading component
Types
Config holds the configuration for a Heading
pub type Config {
Config(
emphasis: Emphasis,
size: config.Size,
variant: Variant,
text: String,
)
}
Constructors
-
Config( emphasis: Emphasis, size: config.Size, variant: Variant, text: String, )
Emphasis specifies if the heading is emphasized
pub type Emphasis {
Emphasized
Standard
}
Constructors
-
Emphasized -
Standard
Heading is the basis for constructing an HTML m3e-heading component
pub opaque type Heading
Values
pub fn default_config() -> Config
default_config creates a new Config with default values
pub const default_emphasis: Emphasis
pub const default_size: config.Size
pub const default_variant: Variant
pub fn emphasized(h: Heading, emphasis: Emphasis) -> Heading
emphasized sets the emphasis field of a Heading
pub fn new(text: String) -> Heading
new creates a Heading using default values
Parameters:
- text: The text content of the heading
pub fn render(
h: Heading,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render creates a Lustre Element from a Heading
pub fn render_config(
config: Config,
attributes: List(attribute.Attribute(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element directly from a Config
pub fn size(h: Heading, size: config.Size) -> Heading
size sets the size field of a Heading