Skip to content

Data Input

CheckboxGroup

Group of checkboxes for multi-select options.

import { CheckboxGroup } from '@var-ui/react';
Features

CheckboxGroup

Group of checkboxes for multi-select options. Pass options as { value, label } pairs; selection is a string array via React Aria CheckboxGroup.

Examples

Default

Provide a group label and options. Selection starts empty unless you seed it.

Features
Demo.tsxTSX
import { CheckboxGroup } from '@var-ui/react';

<CheckboxGroup
  label="Features"
  options={[
    { value: 'analytics', label: 'Analytics' },
    { value: 'billing', label: 'Billing' },
  ]}
/>

Default values

Seed an uncontrolled group with defaultValue (string array). Use value + onValueChange when selection must stay controlled.

Features
Demo.tsxTSX
import { CheckboxGroup } from '@var-ui/react';

<CheckboxGroup
  label="Features"
  defaultValue={['analytics', 'billing']}
  options={[
    { value: 'analytics', label: 'Analytics' },
    { value: 'billing', label: 'Billing' },
    { value: 'support', label: 'Priority support' },
  ]}
/>

Sizes

size (sm, md, lg) scales every checkbox, its label and the gap; the group size applies to all options. It falls back to the surrounding control size (InputGroup, Toolbar, Select.Root), then md.

Props

Accessibility

Built on React Aria CheckboxGroup. The group label associates with the set of checkboxes; each option keeps its own label beside the control. Keyboard users can move between options and toggle with Space. Prefer a visible group label so the purpose of the set is clear.