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]"whennil):unchecked_symbol- custom string for the unchecked state (rendered as"[ ]"whennil):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
@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 }