Skip to content

CheckboxGroup ​

Group of checkboxes for multi-select from a list of options. Normalizes various option formats and supports custom value parsing.

Shared option API

Accepts the shared option formats — primitive arrays, object arrays with extractors and key-value objects. See Option Extractors.

Import ​

typescript
import { CheckboxGroup } from 'vuiii'

Basic Usage ​

vue
<CheckboxGroup v-model="selectedFruits" :options="['Apple', 'Banana', 'Cherry']" />

The model is always an array holding the values of the checked options.

Props ​

PropTypeDefaultDescription
modelValueany[]-Array of selected values (v-model)
optionsany[] | Record<string, any>-Options to render as checkboxes
optionLabelstring | ((item) => any)-Key or function to extract the display label
optionValuestring | ((item) => any)-Key or function to extract the option value
optionDisabledstring | ((item) => any)-Key or function to mark an option as disabled
optionDescriptionstring | ((item) => any)-Key or function to extract description text
valueParserValueParser-Custom parser for option values
type'string' | 'number' | 'boolean' | 'date'-Type used to parse option values
disabledbooleanfalseDisables every checkbox in the group
readonlybooleanfalseShows the selection, but blocks changing it
requiredbooleanfalseMarks the group as required
invalidbooleanfalseRenders the validation error state
inlinebooleanfalseRenders checkboxes horizontally
size'small' | 'normal' | 'large''normal'Checkbox size

Slots ​

SlotDescription
defaultReserved default slot
symbolCustom checkbox symbol. Props: { checked, disabled, invalid }

Events ​

The CheckboxGroup exposes the selected values through v-model (update:modelValue). It emits no other custom events.

With Descriptions ​

vue
<script setup>
const permissions = [
  { id: 'read', name: 'Read', info: 'View content' },
  { id: 'write', name: 'Write', info: 'Edit content' },
  { id: 'delete', name: 'Delete', info: 'Remove content' },
]
</script>

<template>
  <CheckboxGroup
    v-model="selectedPermissions"
    :options="permissions"
    option-value="id"
    option-label="name"
    option-description="info"
  />
</template>

Inline Layout ​

vue
<CheckboxGroup v-model="selected" :options="['Option A', 'Option B', 'Option C']" inline />

Typed Values ​

type applies to every entry of the array, so a numeric model stays numeric both ways — the emitted values and the ones matched against the options.

vue
<!-- selectedIds is number[], and a model of [1] checks the first option -->
<CheckboxGroup
  v-model="selectedIds"
  :options="[
    { id: 1, name: 'One' },
    { id: 2, name: 'Two' },
  ]"
  option-value="id"
  option-label="name"
  type="number"
/>

Disabled Options ​

vue
<CheckboxGroup
  v-model="selected"
  :options="options"
  option-value="id"
  option-label="name"
  option-disabled="locked"
/>

A Single Checkbox ​

For one standalone boolean, use Checkbox — it binds a boolean rather than an array.

Storybook

For interactive examples with all variants, see CheckboxGroup in Storybook.

Released under the MIT License.