Skip to main content

Checkbox

The Checkbox component provides users the ability to choose between two distinct values. These are very similar to a switch and can be used in complex forms and checklists. A simpler version, checkbox is used primarily as a lightweight alternative in data-table components to select rows or display inline boolean data.

info

For more details about Vuetify’s usage of Checkbox component, click Checkbox page.
For more prop explanations, click Vuetify Checkbox API page.

Props

AttributeDescriptionTypeDefault
classprop that determines the class to add to the checkbox.stringundefined
compareValueQLegend is used for comparison values. You can look at the QLegend document.stringundefined
compareTextQLegend is used for comparison values. You can look at the QLegend document.stringundefined
compareTableValueQLegend is used for comparison values. You can look at the QLegend document.stringundefined
valuespecifies the vmodel value of the checkbox.booleanfalse
darkApplies the dark theme variant to the component.booleanfalse
disabledDisable the input.booleanfalse
errorPuts the input in a manual error state.booleanfalse
errorCountThe total number of errors that should display at once.number | string1
errorMessagesPuts the input in an error state and passes through custom error messages. Will be combined with any validations that occur from the rules prop.array[]
hideDetailsHides hint and validation errors. When set to auto messages will be rendered only if there’s a message (hint, error message, counter value etc) to display.boolean | stringundefined
indeterminateIconThe icon used when in an indeterminate state.string'$checkboxIndeterminate'
labelSets input label.string'My CheckBox'
loadingAdds a loading icon animation.booleanfalse
multipleChanges expected model to an array.booleanfalse
offIconThe icon used when inactive.string'$checkboxOff'
onIconThe icon used when active.string'$checkboxOn'
hintHint text.stringundefined
rulesAccepts a mixed array of types function, boolean and string. Functions pass an input value as an argument and must return either true / false or a string containing an error message. The input field will enter an error state if a function returns (or any value in the array contains) false or is a string.array[]
successPuts the input in a manual success state.booleanfalse
successMessagesPuts the input in a success state and passes through custom success messages.string | array[]
persistentHintForces hint to always be visible.booleanfalse
readonlyPuts input in readonly state.booleanfalse
rippleApplies the ripple directive.booleanobject
tabIndexIt determines the order of switching from one component to another with the tab key.stringundefined
visibleVisibility of Checkbox component.booleantrue

Events

AttributeDescription
click(mouseEvent)Emitted when input is clicked
change(checked)Emitted when the input is changed by user interaction

Samples Component

image

Samples Qjson

CheckboxDisabledExample
CheckBoxQvalue