Skip to content

Checkbox ​

te-checkbox is a native checkbox themed with accent-color.

Basic ​

vue
<te-checkbox label="Accept the terms" />

Disabled ​

vue
<te-checkbox label="Disabled" disabled />

Custom label ​

The default slot receives the current value.

vue
<te-checkbox>
  <template #default="{ selected }">
    <strong>{{ selected ? 'On' : 'Off' }}</strong>
  </template>
</te-checkbox>

Groups ​

Bind an array and give each box a nativeValue:

vue
<te-checkbox v-model="picked" native-value="a" label="A" />
<te-checkbox v-model="picked" native-value="b" label="B" />

Props ​

PropTypeDefaultDescription
modelValueboolean | (string | number)[]falseSupports v-model. Use an array with nativeValue for groups.
labelstring''Text next to the box.
disabledbooleanfalseDisables the checkbox.
nativeValuestring | numberundefinedValue contributed to an array modelValue.

Events ​

EventPayloadDescription
update:modelValueboolean | (string | number)[]Value changed.

Slots ​

SlotPropsDescription
default{ selected }Replaces the label.