Skip to content

CheckboxGroup

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

Import

typescript
import { CheckboxGroup } from 'vuiii'

Basic Usage

vue
// Basic usage with string array import { CheckboxGroup } from 'vuiii'

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

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
inlinebooleanfalseRenders checkboxes horizontally

Slots

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

Events

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

More Examples

vue
// With object options and extractors const permissions = [ { id: 'read', name: 'Read', info: 'View content' }, { id:
'write', name: 'Write', info: 'Edit content' }, { id: 'delete', name: 'Delete', info: 'Remove content' } ]

<CheckboxGroup
  v-model="selectedPermissions"
  :options="permissions"
  option-value="id"
  option-label="name"
  option-description="info"
/>
vue
// Inline layout (horizontal)
<CheckboxGroup v-model="selected" :options="['Option A', 'Option B', 'Option C']" inline />
vue
// With type parsing (values will be numbers)
<CheckboxGroup
  v-model="selectedIds"
  :options="[
    { id: 1, name: 'One' },
    { id: 2, name: 'Two' },
  ]"
  option-value="id"
  option-label="name"
  type="number"
/>

Storybook

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

Released under the MIT License.