Terms confirmation
Require a single explicit acknowledgement before submitting a form.
Components / Forms
A native checkbox for boolean or array models, including mixed state.
Require a single explicit acknowledgement before submitting a form.
Bind several native checkboxes to one array of selected values.
<script setup lang="ts">
import { ref } from 'vue'
import Checkbox from './components/ui/checkbox/Checkbox.vue'
const accepted = ref(false)
</script>
<template>
<Checkbox v-model="accepted" required>Accept the terms</Checkbox>
</template>The wrapping label enlarges the clickable text target.
<script setup lang="ts">
import { ref } from 'vue'
import Checkbox from './components/ui/checkbox/Checkbox.vue'
const accepted = ref(false)
</script>
<template>
<label><Checkbox v-model="accepted" name="terms" required /> I accept the terms</label>
</template>Array mode emits a new array when a choice changes.
<script setup lang="ts">
import { ref } from 'vue'
import Checkbox from './components/ui/checkbox/Checkbox.vue'
const channels = ref<string[]>(['email'])
</script>
<template>
<label><Checkbox v-model="channels" value="email" name="channel" /> Email</label>
<label><Checkbox v-model="channels" value="sms" name="channel" /> Text message</label>
</template>The most useful props, models, slots, events, and methods for this component.
| Name | Type | Default or requirement |
|---|---|---|
v-model | boolean | value[] | false |
value | generic value | undefined |
indeterminate | boolean | false |
invalid | boolean | false |
The underlying input retains native form, label, and keyboard behavior.