Forms
ICheckbox
A checkbox for a choice that is submitted rather than applied on the spot. The model is tri-state: true, false, or 'indeterminate' for a parent whose children disagree. For a setting that takes effect immediately, use ISwitch.
With a description
Store a PDF of every invoice you send, for seven years.
Indeterminate
Set the model to the string 'indeterminate' for the mixed state. A "select all" checkbox is then one binding derived from its children, which is what ITable's header checkbox does.
Model: indeterminate
Cards and tiles
variant changes the shape. card makes the whole bordered surface the control.
tile centres an icon above the label. Several in a row make a picker where more than one can be on.
Sizes
Disabled
Props
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | — | Text beside the box, wired to it |
description | string | — | Secondary line under the label |
variant | 'checkbox' | 'card' | 'tile' | 'checkbox' | Shape of the control |
icon | IconLike | — | Shown above the label by the tile variant |
size | 'sm' | 'md' | 'lg' | 'md' | Control scale |
id | string | generated | Useful when an external ILabel targets it |
invalid | boolean | — | Mark as failing validation. Taken from the enclosing IFormField when omitted |
unstyled | boolean | — | Drop built-in classes |
class | string | — | Merged with the built-in classes |
ui | { wrapper?, root?, mark?, icon?, indicator?, content?, label?, description? } | — | Per-element class overrides |
The model is boolean | 'indeterminate'. disabled, required, name and value are forwarded to the underlying control, so the checkbox posts in a plain <form>.
Slots
| Slot | When to use it |
|---|---|
label | The label needs markup, such as a link inside it |
description | Same, for the description |