sigilUI

Checkbox Group

A multi-select checkbox group with shared state, sub-labels, and disabled support.

@sigil-ui/componentsReact

Preview

Live preview Interactive

Import

import { CheckboxGroup, CheckboxGroupItem } from "@sigil-ui/components";

Usage

<CheckboxGroup defaultValue={["a"]} onValueChange={(value) => console.log(value)}>
  <CheckboxGroupItem value="a" label="Option A" description="Short explainer." />
  <CheckboxGroupItem value="b" label="Option B" />
</CheckboxGroup>

You can also pass an items array as a shorthand:

<CheckboxGroup
  items={[
    { value: "a", label: "Option A" },
    { value: "b", label: "Option B" },
  ]}
/>

Sub-components

This component includes the following parts:

  • <CheckboxGroupItem>

Props

CheckboxGroup

PropTypeDefaultDescription
valuestring[]—Controlled selection.
defaultValuestring[][]Uncontrolled initial selection.
onValueChange(value: string[]) => void—Called with the next selection on every toggle.
disabledbooleanfalseDisables every item in the group.
namestring—Form field name applied to each underlying checkbox.
itemsCheckboxGroupItemConfig[]—Shorthand for rendering items without children.
orientation"vertical" | "horizontal""vertical"Stacks items in a column or wraps them in a row.

CheckboxGroupItem

PropTypeDefaultDescription
valuestring—Item value used to identify the selection.
labelReactNode—Primary label text.
descriptionReactNode—Optional secondary copy displayed below the label.
disabledbooleanfalseDisables this individual item.

Token integration

CSS VariablePurpose
--s-textItem label color
--s-text-mutedItem description color
--s-primarySelected checkbox fill
--s-primary-contrastCheckmark color on selected state
--s-borderUnselected checkbox border
--s-border-styleBorder style (solid / dashed / dotted)
--s-radius-smCheckbox corner radius
--s-focus-ring-colorFocus ring color
--s-focus-ring-widthFocus ring width