Checkbox with label, description, and error states.
<.checkbox field={@form[:accept]} label="Accept the terms" />
<.checkbox name="notify" checked={@notify} label="Email me" description="At most one per day." />The API mirrors Fluxon's checkbox/1 (field/name/checked,
checked_value/unchecked_value, label/sublabel/description,
errors), so a use Fluxon app can swap imports without template changes.
A hidden input submits unchecked_value when the box is unchecked, so forms
always receive the param. (checkbox_group/1 is not yet implemented.)
Summary
Functions
Attributes
id(:any) - Defaults tonil.name(:string) - Defaults tonil.value(:any) - Defaults tonil.checked(:boolean) - Defaults tonil.checked_value(:any) - Defaults to"true".unchecked_value(:any) - Defaults to"false".label(:string) - Defaults tonil.sublabel(:string) - Defaults tonil.description(:string) - Defaults tonil.errors(:list) - Defaults to[].class(:any) - Defaults tonil.field(Phoenix.HTML.FormField) - Defaults tonil.disabled(:boolean) - Defaults tofalse.- Global attributes are accepted.