Checkbox

A group of options for multiple choices.

Basic usage

Checkbox can be used alone to switch between two states.

Disabled State

Disabled state for checkbox.

Checkbox Group

It is used for multiple checkboxes which are bound in one group, and indicates whether one option is selected by checking if it is checked.

checkbox-group element can manage multiple checkboxes in one group by using v-model which is bound as an Array. Inside the b-checkbox element, value is the value of the checkbox. If no content is nested in that tag, label will be rendered as the description following the button of the checkbox. value also corresponds with the element values in the array. It is selected if the specified value exists in the array, and vice versa.

Indeterminate

The indeterminate property can help you to achieve a 'check all' effect.

Min / Max

The min and max properties can help you to limit the number of checked items.

Button Style

Checkbox with button styles.

You just need to change b-checkbox element into b-checkbox-button element. We also provide size attribute.

With icon

The icon attribute adds a icon to Checkboxes.

Checkbox Attributes

AttributeDescriptionTypeAccepted ValuesDefault
model-value / v-modelbinding valuestring / number / boolean——
valuevalue of the Checkbox when used inside a checkbox-groupstring / number / boolean / object——
true-valuevalue of the Checkbox if it's checkedstring / number——
false-valuevalue of the Checkbox if it's not checkedstring / number——
disabledwhether the Checkbox is disabledboolean—false
iconwhether to add a icon to the Checkboxboolean—false
sizesize of the Checkboxstringlarge / default /small—
namenative 'name' attributestring——
checkedif the Checkbox is checkedboolean—false
indeterminatesame as indeterminate in native checkboxboolean—false
validate-eventwhether to trigger form validationboolean-true

Checkbox Events

Event NameDescriptionParameters
changetriggers when the binding value changesthe updated value

Checkbox Slots

NameDescription
—customize default content
iconcustomize icon
subcustomize substitution

Checkbox-Group Attributes

AttributeDescriptionTypeAccepted ValuesDefault
model-value / v-modelbinding valuearray—[]
sizesize of checkboxstringlarge / default /small—
disabledwhether the nesting checkboxes are disabledboolean—false
minminimum number of checkbox checkednumber——
maxmaximum number of checkbox checkednumber——
labellabel for screen readerstring——
validate-eventwhether to trigger form validationboolean-true

Checkbox-Group Events

Event NameDescriptionParameters
changetriggers when the binding value changesthe updated value

Checkbox-Group Slots

NameDescriptionSubtags
-customize default contentCheckbox / Checkbox-button

Checkbox-Button Attributes

AttributeDescriptionTypeAccepted ValuesDefault
valuevalue of the checkbox when used inside a checkbox-groupstring / number / boolean / object——
true-valuevalue of the checkbox if it's checkedstring / number——
false-valuevalue of the checkbox if it's not checkedstring / number——
disabledwhether the checkbox is disabledboolean—false
namenative 'name' attributestring——
checkedif the checkbox is checkedboolean—false

Checkbox-Button Slots

NameDescription
—customize default content
iconcustomize icon
Last Updated:
Contributors: Tam Mai