Boxes to tick and options to pick, as the canvas draws them: the checkbox (with the partial state of "select
all"), the radio with its description and the choice card. They are real <input>s, so the browser, the form
and the keyboard do the work; the look comes from the checkbox, radio and choice-card classes.
checkbox_group/1 and radio_group/1 are the <fieldset> with its <legend> that name a set of boxes or
options, with a help text, an error and the required mark of the group. The radio group is a radiogroup
whose arrow keys are the browser's own for radios sharing a name. size={:sm} is the 18px box on a 40px
row for dense lists, and variant={:task} on a checkbox is the round 22px tick of a task list, whose text is
struck through once it is done.
Summary
Functions
A <fieldset> with a <legend> around a set of checkboxes, with the help and the error of the group.
A whole card that is the option: it gains the border and the wash of the choice when ticked.
A radiogroup <fieldset> with a <legend> around radios that share a name; the arrow keys are the browser's.
The state of a "select all" box: :none, :some (partial) or :all, from how many of total are ticked.
Functions
Attributes
id(:string) (required)name(:string) - Defaults tonil.value(:string) - Defaults to"true".checked(:boolean) - Defaults tofalse.partial(:boolean) - the dash of a "select all" with only some ticked; theDevactionUI.Indeterminatehook sets the element'sindeterminateso assistive technology hears it too. Defaults tofalse.label(:string) - Defaults tonil.description(:string) - Defaults tonil.size(:atom) - Defaults to:md. Must be one of:md, or:sm.variant(:atom) -:taskis the round tick of a task list; the text is struck through once it is checked. Defaults to:default. Must be one of:default, or:task.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "required", "form", "autofocus"].
A <fieldset> with a <legend> around a set of checkboxes, with the help and the error of the group.
Attributes
id(:string) (required)legend(:string) (required) - what the boxes choose, as the group's name.help(:string) - a hint under the boxes, tied to the group. Defaults tonil.error(:string) - what is wrong with the group, as an alert. Defaults tonil.required(:boolean) - marks the legend with an asterisk; putrequiredon the boxes that must be ticked. Defaults tofalse.orientation(:atom) - Defaults to:vertical. Must be one of:vertical, or:horizontal.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "form"].
Slots
inner_block(required) - thecheckbox/1s of the group.
A whole card that is the option: it gains the border and the wash of the choice when ticked.
Attributes
id(:string) (required)name(:string) (required)value(:string) (required)type(:string) - Defaults to"radio". Must be one of"radio", or"checkbox".checked(:boolean) - Defaults tofalse.label(:string) (required)description(:string) - Defaults tonil.layout(:atom) -:rowputs the mark, the text and the input in a line;:stackputs the mark above the text. Defaults to:row. Must be one of:row, or:stack.invalid(:boolean) - the card is drawn with the border of an error. Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "required", "form", "autofocus"].
Slots
icon- a mark at the start of the card.
Attributes
id(:string) (required)name(:string) (required)value(:string) (required)checked(:boolean) - Defaults tofalse.label(:string) (required)description(:string) - Defaults tonil.size(:atom) - Defaults to:md. Must be one of:md, or:sm.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "required", "form", "autofocus"].
A radiogroup <fieldset> with a <legend> around radios that share a name; the arrow keys are the browser's.
Attributes
id(:string) (required)legend(:string) (required) - what the options choose, as the group's name.help(:string) - a hint under the options, tied to the group. Defaults tonil.error(:string) - what is wrong with the group, as an alert. Defaults tonil.required(:boolean) - marks the group as required, for assistive technology and with an asterisk. Defaults tofalse.orientation(:atom) - Defaults to:vertical. Must be one of:vertical, or:horizontal.class(:any) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "form"].
Slots
inner_block(required) - theradio/1s orchoice_card/1s of the group.
@spec select_all_state(non_neg_integer(), non_neg_integer()) :: :none | :some | :all
The state of a "select all" box: :none, :some (partial) or :all, from how many of total are ticked.