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

pub opaque type Toggler

Values

pub fn a11y(t: Toggler, a: a11y.A11y) -> Toggler

Set accessibility properties for this widget.

pub fn build(t: Toggler) -> node.Node

Build the toggler into a renderable Node.

pub fn disabled(t: Toggler, d: Bool) -> Toggler

Set whether the widget is disabled.

pub fn font(t: Toggler, f: font.Font) -> Toggler

Set the font.

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 size(t: Toggler, s: Float) -> Toggler

Set the size.

pub fn spacing(t: Toggler, s: Int) -> Toggler

Set the spacing between children.

pub fn style(t: Toggler, s: String) -> Toggler

Set the style.

pub fn text_alignment(
  t: Toggler,
  a: alignment.Alignment,
) -> Toggler

Set the text alignment.

pub fn text_size(t: Toggler, s: Float) -> Toggler

Set the text size in pixels.

pub fn width(t: Toggler, w: length.Length) -> Toggler

Set the width.

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.

Search Document