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

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

Variant is the appearance of the heading

pub type Variant {
  Display
  Headline
  Label
  Title
}

Constructors

  • Display
  • Headline
  • Label
  • Title

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 from_config(c: Config) -> Heading

from_config creates a Heading from a Config record

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

pub fn variant(h: Heading, variant: Variant) -> Heading

variant sets the variant field of a Heading

Search Document