ExRatatui.Widgets.Checkbox (ExRatatui v0.7.1)

Copy Markdown View Source

A checkbox widget for toggling boolean values.

Renders a checkbox symbol followed by a label. Useful for yes/no toggles, multi-select option lists, and boolean prompts.

Fields

  • :label - the text displayed next to the checkbox
  • :checked - whether the checkbox is checked (default: false)
  • :style - %ExRatatui.Style{} for the label text
  • :checked_style - %ExRatatui.Style{} for the checkbox symbol
  • :checked_symbol - custom string for the checked state (rendered as "[x]" when nil)
  • :unchecked_symbol - custom string for the unchecked state (rendered as "[ ]" when nil)
  • :block - optional %ExRatatui.Widgets.Block{} container

Examples

iex> %ExRatatui.Widgets.Checkbox{label: "Enable notifications", checked: true}
%ExRatatui.Widgets.Checkbox{
  label: "Enable notifications",
  checked: true,
  style: %ExRatatui.Style{},
  checked_style: %ExRatatui.Style{},
  checked_symbol: nil,
  unchecked_symbol: nil,
  block: nil
}

Summary

Types

t()

@type t() :: %ExRatatui.Widgets.Checkbox{
  block: ExRatatui.Widgets.Block.t() | nil,
  checked: boolean(),
  checked_style: ExRatatui.Style.t(),
  checked_symbol: String.t() | nil,
  label: String.t(),
  style: ExRatatui.Style.t(),
  unchecked_symbol: String.t() | nil
}