Skip to content

Checkbox ​

A labeled checkbox built on reka-ui's Checkbox. Use it where a boolean reads as an option to tick, such as items in a list of settings; use Toggle for a switch that takes effect immediately.

Examples ​

Basic ​

vue
<script setup>
import { ref } from "vue";
const vaccination = ref(false);
</script>

<Checkbox v-model="vaccination" label="Enable vaccination" />

Description and hint ​

description renders under the label and is linked to the checkbox with aria-describedby. hint adds the (?) tooltip after the label.

Infected individuals stop mixing once symptoms appear
vue
<Checkbox
  v-model="isolation"
  label="Isolate symptomatic cases"
  description="Infected individuals stop mixing once symptoms appear"
  hint="Isolation starts on the day of symptom onset"
/>

Indeterminate ​

Set indeterminate on a parent checkbox whose children are partly selected. It draws a dash in place of the checked state; the next click emits true, and the consumer clears indeterminate itself, as with the native property.

vue
<script setup>
import { ref } from "vue";
const regions = ref(false);
const partial = ref(true);
</script>

<Checkbox
  v-model="regions"
  :indeterminate="partial"
  label="All regions"
  @update:model-value="partial = false"
/>

Disabled ​

vue
<Checkbox v-model="locked" label="Locked setting" disabled />

Model ​

NameType
v-modelboolean

Props ​

PropTypeRequiredDefault
labelstringYes—
descriptionstringNo—
hintstringNo—
disabledbooleanNo—
indeterminatebooleanNo—