Checkbox
Use VCheckbox for independent choices or confirmation, such as accepting terms.
Usage
Examples
Hint
Use label or the default slot for the name. hint adds help text linked through aria-describedby.
A summary of the week, every Monday.
Only when someone names you.
Label position
labelPosition="start" places the label before the checkbox.
Full width
spread fills the available width and places the label and checkbox at opposite ends.
Indeterminate
indeterminate indicates a partial selection, such as some items in a list being checked. It does not change the boolean v-model.
Read-only
readonly prevents changes by click or Space while preserving focus and native form behavior. A read-only, unchecked field with required still fails native form validation.
Disabled
disabled prevents changes and removes the checkbox from Tab navigation and form submission.
API
Props
| Prop | Type | Default |
|---|---|---|
label | string | none |
Visible label, replaced by the default slot. Without either, provide aria-label or aria-labelledby. | ||
hint | string | none |
Help text below the label, linked through aria-describedby. | ||
error | string | none |
Error message shown in place of the hint. Sets aria-invalid, is linked through aria-describedby and is announced when it appears. | ||
indeterminate | boolean | false |
Displays a partial-selection state. Independent of v-model, which remains a boolean. | ||
labelPosition | CheckboxLabelPosition'start' | 'end' | 'end' |
Label before the checkbox with start, or after it with end. | ||
spread | boolean | false |
| Fills the available width and separates the label and checkbox. | ||
invalid | boolean | false |
Sets aria-invalid and the error style. Does not block form submission by itself. | ||
disabled | boolean | false |
| Disables the checkbox and excludes it from focus and form submission. | ||
readonly | boolean | false |
Prevents changes while keeping the checkbox focusable. Sets aria-readonly; native form submission and validation still apply. | ||
v-model | boolean | false |
Checked state, a boolean defaulting to false. Use native name and value attributes for form submission. | ||
Slots
| Slot | Type |
|---|---|
default | {} |
Clickable label content, replacing label. | |
CSS variables
| Token | Value |
|---|---|
--vectis-control-size-check | 1.25rem |
--vectis-control-size-check-mark | 0.875rem |