Skip to content

CheckboxGroup ​

Group of checkboxes with a shared legend, built on a semantic <fieldset> element.

Live Demo ​

Vertical (default) ​

Permissions
Notify me via
Permissions: read
Notifications: email, push

Horizontal ​

Notify me via

With Error ​

Working days
Please select at least one day.

Slot-based Composition ​

Use the default slot to place <orio-check-box> components directly when you need custom logic per option.

Frameworks
Selected: vue

Usage ​

Basic ​

vue
<template>
  <orio-checkbox-group
    v-model="selected"
    label="Permissions"
    :options="options"
  />
</template>

<script setup>
import { ref } from "vue";

const selected = ref(["read"]);
const options = [
  { label: "Read", value: "read" },
  { label: "Write", value: "write" },
  { label: "Delete", value: "delete" },
];
</script>

Horizontal Layout ​

vue
<orio-checkbox-group
  v-model="selected"
  label="Notify me via"
  layout="horizontal"
  :options="options"
/>

With Error ​

vue
<orio-checkbox-group
  v-model="selected"
  label="Working days"
  :options="dayOptions"
  :error="selected.length === 0 ? 'Select at least one day.' : null"
/>

Slot-based ​

Use the slot when you need per-option custom markup or icons. Pass appearance="minimal" to each CheckBox so it strips its outer margin.

vue
<orio-checkbox-group v-model="selected" label="Frameworks">
  <orio-check-box
    appearance="minimal"
    :model-value="selected.includes('vue')"
    @update:model-value="toggle('vue')"
  >
    Vue
  </orio-check-box>
  <orio-check-box
    appearance="minimal"
    :model-value="selected.includes('react')"
    @update:model-value="toggle('react')"
  >
    React
  </orio-check-box>
</orio-checkbox-group>

Props ​

PropTypeDefaultDescription
modelValueunknown[][]Array of selected values (v-model)
optionsCheckboxOption[][]List of options to render (ignored when slot used)
labelstringundefinedLegend text for the group
layout"vertical" | "horizontal""vertical"Legend position relative to the checkboxes
size"sm" | "md" | "lg" | "xl""md"Size of the checkboxes and label
errorstring | nullnullError message displayed below the group

CheckboxOption ​

ts
interface CheckboxOption {
  label: string;
  value: unknown;
}

Events ​

EventPayloadDescription
update:modelValueunknown[]Emitted when any checkbox is toggled

Slots ​

SlotDescription
defaultCustom checkbox content. Overrides options prop. Use appearance="minimal" on each <orio-check-box>.

Accessibility ​

  • Renders as <fieldset> with <legend> — screen readers announce the group label before each individual checkbox.
  • Each <orio-check-box> inside uses a native <input type="checkbox"> with a visible <label>, so focus, keyboard, and screen reader behaviour are fully native.