Checkboxes are an easily understandable way to indicate that users can select one or more answers to a question or items from a list. They visibly show users what's been selected and makes it easy for them to "uncheck" an option, which can be difficult with other selection methods on a form (such as radio buttons or select menus).
label or the checkbox element itself to toggle an option, aiding accessibility.indeterminate checkboxes convey a "mixed" state that neither qualifies as checked or unchecked. An example use case is when a checkbox acts as a "parent" of a collection of child checkboxes:
checked: all children are checked.unchecked: all children are not checked.indeterminate: children are a mix of checked and unchecked.<!-- Default --> <dt-checkbox name="default" value="Value" label="Checkbox label" /> <!-- Checked --> <dt-checkbox name="checked" value="Value" label="Checkbox label" checked /> <!-- Disabled --> <dt-checkbox name="disabled" value="Value" label="Disabled Checkbox label" disabled /> <!-- Disabled Checked --> <dt-checkbox name="disabled-checked" value="Value" label="Disabled Checkbox label" checked disabled />
<!-- Indeterminate --> <dt-checkbox name="indeterminate" value="Value" label="Indeterminate checkbox" indeterminate /> <!-- Indeterminate disabled --> <dt-checkbox name="indeterminate-disabled" value="Value" label="Indeterminate checkbox disabled" checked disabled indeterminate />
<dt-checkbox-group legend="Call Blocking & Spam Protection" :model-value="[]"> <dt-checkbox name="option1" value="Value" label="Anonymous callers" /> <dt-checkbox name="option2" value="Value" label="Block callers not already in contacts list" /> <dt-checkbox name="option3" value="Value" label="Block callers with a high spam score" /> </dt-checkbox-group>
<dt-checkbox-group legend="Call Blocking & Spam Protection" :model-value="[]"> <dt-checkbox name="option1" value="Value" label="Anonymous callers" description="Select how phone numbers you dont know should be handled." /> <dt-checkbox name="option2" value="Value" label="Block callers not already in contacts list" description="You get enough calls. Free up some of your time." /> <dt-checkbox name="option3" value="Value" label="Block callers with a high spam score" description="We will only let the legitimate callers through to bother you." /> </dt-checkbox-group>
<dt-checkbox-group legend="Call Blocking & Spam Protection" :model-value="[]"> <dt-checkbox name="option1" value="Value" label="Anonymous callers" validation-state="warning" :messages="[{ message: `Select how phone numbers you dont know should be handled.`, type: `warning` }]" /> <dt-checkbox name="option2" value="Value" label="Block callers not already in contacts list" validation-state="critical" :messages="[{ message: `You get enough calls. Free up some of your time.`, type: `critical` }]" /> <dt-checkbox name="option3" value="Value" label="Block callers with a high spam score" validation-state="positive" :messages="[{ message: `We will only let the legitimate callers through to bother you.`, type: `positive` }]" /> </dt-checkbox-group>
Use the label-size prop to override the default label size.
<dt-checkbox name="sizeXs" value="Value" label="Extra small label" :label-size="100" /> <dt-checkbox name="sizeSm" value="Value" label="Small label" :label-size="200" /> <dt-checkbox name="sizeMd" value="Value" label="Medium label (default)" :label-size="300" /> <dt-checkbox name="sizeLg" value="Value" label="Large label" :label-size="400" />
The best accessibility is semantic HTML. Most screen readers understand how to parse inputs if they're correctly formatted. When it comes to checkboxes, there are a few things to keep in mind:
id attribute.for attribute. This correlates with the checkbox's id.fieldset to group them and a legend to title the group. For further information, please visit Gov.UK's article, "Using the fieldset and legend elements".aria-describedby with the id of the description text.aria-required property and use the validation message for input errors.aria-describedby with the id of the validation message.import { DtCheckbox } from '@dialpad/dialtone-vue';
Name
|
Type
|
|---|---|
default | slot for Checkbox Label |
description | slot for Checkbox Description |
Name
|
Default
|
Type
|
|---|---|---|
description | '' | string Describes the input |
descriptionChildProps | {} | object A set of props that are passed into the description container |
descriptionClass | '' | string|array|object Used to customize the description container |
disabled | false | boolean Disables the input |
indeterminate | false | boolean Indeterminate State, toggling indeterminate checkbox will uncheck |
inputClass | '' | string|array|object Used to customize the input element |
label | '' | string A provided label for the input |
labelChildProps | {} | object A set of props that are passed into the label container |
labelClass | '' | string|array|object Used to customize the label container |
labelSize | null |
"100"
|
"200"
|
"300"
|
"400"
Overrides the label text size. |
labelStrength | null |
"bold"
|
"semibold"
|
"medium"
|
"normal"
Overrides the label font weight. |
messages | [] | array Validation messages |
messagesChildProps | {} | object A set of props that are passed into the validation messages component |
messagesClass | '' | string|array|object Used to customize the validation messages component |
name | '' | string The name of the input |
showLabel | true |
"true"
|
"false"
Determines visibility of checkbox label. |
showMessages | true |
"true"
|
"false"
Used to hide / show the validation messages |
v-model | false | boolean Used to set the checked state of the checkable input |
validationState | '' | string The validation state of the input |
value | null | string|number|boolean The value of the input |
Name
|
Type
|
|---|---|
focusin | FocusEvent Native input focusin event |
focusout | FocusEvent Native input focusout event |
update:modelValue | Boolean Event fired to sync the modelValue prop with the parent component |
Class
|
Applies to
|
Description
|
|---|
Checkbox documentation last updated Friday, September 4, 2026
fix/popover-modal-zindex-scope