Components
BaseCheckbox
A single checkbox with its text, validation and an indeterminate state.
components/ui/inputs/BaseCheckbox.vue
View in the demo
Example
API
It also accepts every prop, slot and event of v-checkbox-btn, which it passes through.
Props
Name | Type | Default | Description |
|---|---|---|---|
text | string | — | The text next to the box. The default slot replaces it, for example to add links. |
indeterminate | boolean | false | Shows the “some selected” state, used by select-all checkboxes. |
rules | ValidationRule[] | — | Validation rules, such as rules.accepted() for terms. |
v-model | boolean | false | Whether it is checked. |
Slots
Name | Slot props | Description |
|---|---|---|
#default | — | Replaces text. |
Events
Name | Payload | Description |
|---|---|---|
@update:modelValue | [value: boolean] | — |
Accessibility
The whole text is part of the control, so clicking it toggles the box. A checkbox without text needs an aria-label.