m3e/app_bar
app_bar provides Lustre support for the M3E App Bar component
Types
AppBar is a prominent user interface component that provides consistent access to key actions, navigation, and contextual information at the top of an application screen
Fields:
- alignment: Whether the title and subtitle are centered
- for: The identifier of the interactive control to which this element is attached
- size: Size of the bar
pub opaque type AppBar
Config holds the configuration for an AppBar
pub type Config {
Config(
alignment: TitleAlignment,
for: option.Option(String),
size: size_few.Size,
)
}
Constructors
-
Config( alignment: TitleAlignment, for: option.Option(String), size: size_few.Size, )
Slot gives type-safe names to each of the defined HTML named slots
pub type Slot {
LeadingIcon
Subtitle
Title
TrailingIcon
}
Constructors
-
LeadingIcon -
Subtitle -
Title -
TrailingIcon
TitleAlignment specifies if the title and subtitle are centered
pub type TitleAlignment {
Centered
Standard
}
Constructors
-
Centered -
Standard
Values
pub fn alignment(a: AppBar, alignment: TitleAlignment) -> AppBar
alignment sets the title alignment
pub fn default_config() -> Config
default_config creates a new Config with default values
pub const default_title_alignment: TitleAlignment
pub fn render(
a: AppBar,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates an M3E App Bar component from an AppBar
pub fn render_config(
config: Config,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render_config creates a Lustre Element directly from a Config
pub fn slot(s: Slot) -> attribute.Attribute(msg)
slot creates a Lustre ‘slot’ attribute for a named Slot