m3e/tabs
tab provides Lustre support for the M3E Tab component
Types
Config holds the configuration for a Tabs
pub type Config {
Config(
disabled_pagination: ScrollButtons,
header_position: HeaderPosition,
next_page_label: String,
previous_page_label: String,
stretch: Stretch,
variant: Variant,
)
}
Constructors
-
Config( disabled_pagination: ScrollButtons, header_position: HeaderPosition, next_page_label: String, previous_page_label: String, stretch: Stretch, variant: Variant, )
HeaderPosition is the position of the tab headers
pub type HeaderPosition {
After
Before
}
Constructors
-
After -
Before
ScrollButtons is whether scroll buttons are disabled, defining the disable-pagination attribute
pub type ScrollButtons {
Scroll
NoScroll
}
Constructors
-
Scroll -
NoScroll
Slot gives type-safe names to each of the defined HTML named slots
pub type Slot {
NextIcon
Panel
PrevIcon
}
Constructors
-
NextIcon -
Panel -
PrevIcon
Stretch defines whether tabs are stretched to fill the header
pub type Stretch {
Stretch
NoStretch
}
Constructors
-
Stretch -
NoStretch
Tabs provides a structured navigation surface for organizing content into distinct views, where only one view is visible at a time
Fields:
- disabled_pagination: Whether scroll buttons are disabled
- header_position: The position of the tab headers
- next_page_label: The accessible label given to the button used to move to the previous page
- previous_page_label: The accessible label given to the button used to move to the next page
- stretch: Whether tabs are stretched to fill the header
- variant: The appearance variant of the tabs
pub opaque type Tabs
Values
pub fn default_config() -> Config
default_config creates a new Config with default values
pub const default_header_position: HeaderPosition
pub const default_next_page_label: String
pub const default_previous_page_label: String
pub const default_scroll_buttons: ScrollButtons
pub const default_stretch: Stretch
pub const default_variant: Variant
pub fn disabled_pagination(
t: Tabs,
disabled_pagination: ScrollButtons,
) -> Tabs
disabled_pagination sets the disabled_pagination field
pub fn header_position(
t: Tabs,
header_position: HeaderPosition,
) -> Tabs
header_position sets the header_position field
pub fn next_page_label(t: Tabs, next_page_label: String) -> Tabs
next_page_label sets the next_page_label field
pub fn previous_page_label(
t: Tabs,
previous_page_label: String,
) -> Tabs
previous_page_label sets the previous_page_label field
pub fn render(
t: Tabs,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
render creates a Lustre Element(msg) from a Tabs
Parameters:
- t: a Tabs
- attributes: additional attributes
- children: additional children
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(msg) for a Slot