plushie/widget/toggler
Toggler widget builder (toggle switch).
Types
Option type for toggler properties.
pub type Opt {
Spacing(Int)
Width(length.Length)
Size(Float)
TextSize(Float)
Font(font.Font)
LineHeight(line_height.LineHeight)
Shaping(shaping.Shaping)
Wrapping(wrapping.Wrapping)
TextAlignment(alignment.Alignment)
Style(String)
Disabled(Bool)
A11y(a11y.A11y)
}
Constructors
-
Spacing(Int) -
Width(length.Length) -
Size(Float) -
TextSize(Float) -
Font(font.Font) -
LineHeight(line_height.LineHeight) -
Shaping(shaping.Shaping) -
Wrapping(wrapping.Wrapping) -
TextAlignment(alignment.Alignment) -
Style(String) -
Disabled(Bool) -
A11y(a11y.A11y)
Values
pub fn line_height(
t: Toggler,
lh: line_height.LineHeight,
) -> Toggler
Set the line height.
pub fn new(
id: String,
label: String,
is_toggled: Bool,
) -> Toggler
Create a new toggler builder.
pub fn shaping(t: Toggler, s: shaping.Shaping) -> Toggler
Set the text shaping strategy.
pub fn text_alignment(
t: Toggler,
a: alignment.Alignment,
) -> Toggler
Set the text alignment.
pub fn with_opts(t: Toggler, opts: List(Opt)) -> Toggler
Apply a list of options to a toggler builder.
pub fn wrapping(t: Toggler, w: wrapping.Wrapping) -> Toggler
Set the text wrapping mode.