Skip to content

Checkbox Group

Select one or more options from a group of checkboxes.

Demos

Size
Frameworks
Vue
Tailwind CSS
Akaza UI

Usage

vue
<script setup lang="ts">
import { Accordion } from '~/components/ui/accordion'

const items = [
  { value: 'source', label: 'Do I own the source?', content: 'Yes. Copy and adapt the files.' },
]
</script>

<template>
  <Accordion :items="items" />
</template>

Installation

Complete the shared installation. Copy CheckboxGroup.vue and index.ts into app/components/ui/checkbox-group/. Also copy the required components: Checkbox.

API

Variants and defaults

PropValuesDefault
sizexs, sm, md, lg, xlsm

Props

PropTypeDefaultDescription
optionsCheckboxGroupOption[]—Options to render.
valueKeystring—Property used as option value.
labelKeystring"label"Property used as label.
descriptionKeystring"description"Property used as description.
disabledKeystring"disabled"Property used as disabled state.
allValuesCheckboxGroupValue[]option valuesValues controlled by the parent checkbox.
parentbooleanfalseRenders a select-all parent checkbox with indeterminate state.
parentLabelstring"Select all"Parent checkbox label.
parentDescriptionstring—Parent checkbox description.
disabledbooleanfalseDisables every item.
requiredbooleanfalseRequires at least one checked item for form submission.
orientation"horizontal" | "vertical""vertical"Layout orientation data attribute.
legendstring—Group label used as accessible name fallback.
namestring—Name used by child checkbox form inputs.
ariaLabelstring—Accessible label when no visible legend exists.
ariaLabelledbystring—External accessible label id.
uiCheckboxGroupUi—Classes for root, legend, item, and nested checkbox parts.

Slots

SlotScoped propsDescription
itemoption, value, checked, disabledReplaces the whole item row. You own the rendered control behavior in this slot.
indicatoroption, checkedChild checkbox indicator.
parent-indicatorcheckedParent checkbox indicator.

Events

EventPayloadDescription
value-change(value, details)Fired before model updates. details.cancel() prevents the update.

Keyboard

KeyBehavior
Tab / Shift + TabMoves through parent and enabled child checkboxes in document order.
Enter / SpaceToggles focused checkbox. Parent control selects or clears allowed values.

Each checkbox remains in the native tab order. The group does not use roving focus.