Skip to content

Checkbox

A group of options for multiple choices.

Basic usage

Checkbox can be used alone to switch between two states.

Controlled

Control whether the check box is selected use v-model (model-value) attribute.

Disabled

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.

Indeterminate

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


Minimum / Maximum items checked

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

Minimum 1, maximum 3

Checkbox group styles

Checkbox with button / border style.

Button Style

Border Style

Sizes

Besides default size, tu-checkbox-group component provides three additional sizes for you to choose among different scenarios. Use attribute size to set additional sizes with mini, small, large.

mini

small

medium

large

mini

small

medium

large

mini

small

medium

large

Checkbox API

Checkbox Attributes

NameDescriptionTypeDefault
v-modelBinding valueString Number Boolean-
labelValue of the Checkbox when used inside a checkbox-groupString Number Boolean Object-
true-labelValue of the Checkbox if it's checkedString Number-
false-labelValue of the Checkbox if it's not checkedString Number-
disabledWhether the Checkbox is disabledBooleanfalse
typeCheckbox typeString-
sizeCheckbox sizeStringmedium
nameNative 'name' attributeString-
checkedIf the Checkbox is checkedBooleanfalse
indeterminateSet indeterminate state, only responsible for style controlBooleanfalse
validate-eventWhether to trigger form validationBooleantrue
tabindexInput tabindexString Number-
idInput idString-
controlsSame as aria-controls, takes effect when indeterminate is trueBoolean-

Checkbox Events

NameDescriptionType
changeTriggers when the binding value changesFunction

Checkbox Slots

NameDescription
defaultCustomize default content

CheckboxGroup API

CheckboxGroup Attributes

NameDescriptionTypeDefault
v-modelBinding valueObject-
labelLabel for screen readerString-
typeCheckboxGroup typeString-
sizeCheckboxGroup sizeStringmedium
disabledWhether the nesting checkboxes are disabledBooleanfalse
minMinimum number of checkbox checkedNumber-
maxMaximum number of checkbox checkedNumber-
text-colorFont color when button is activeString-
tagElement tag of the checkbox groupStringdiv
validate-eventWhether to trigger form validationBooleantrue

CheckboxGroup Events

NameDescriptionType
changeTriggers when the binding value changesFunction

CheckboxGroup Slots

NameDescriptionType
defaultCustomize default contentCheckbox