sheengemologic ui
All components

CheckboxGroup

A native fieldset of independent choices with shared selection ownership.@gemologic/sheen · forms

Playground

Alert channels
<CheckboxGroup label="Alert channels" name="channels" options={[{ value: "email", label: "Email" }, { value: "desktop", label: "Desktop" }]} defaultValue={["email"]} />

Variant matrix

Alert channels
Alert channels

Anatomy

Package
@gemologic/sheen
Source
packages/ui/src/primitives/CheckboxGroup.tsx
Tokens
  • --sheen-space-block-sm
  • --sheen-color-fg-muted
  • --sheen-color-danger-fg

Accessibility

Role: groupKeyboard: Tab, Shift+Tab, Space

Do

  • Use unique stable values and short group legends.
  • Validate minimum selections in the app and provide a group error.

Do not

  • Do not mark every checkbox required to require at least one selection.

Generated props

NameTypeDefaultDescription
label *stringRequired visible group legend.
options *readonly CheckboxOption[]Options keyed by unique value; replacing objects or reordering retains surviving controls.
valuereadonly string[]App-owned selected values; reset does not change them unless the app does.
defaultValuereadonly string[]Captured uncontrolled initial selection restored by uncanceled reset.
onValueChange(value: string[]) => voidReceives a fresh deduplicated selection array on changes.
descriptionstringSupporting instructions associated with the fieldset.
errorstringGroup validation message; marks the fieldset invalid without moving focus.
readOnlybooleanfalsePrevents option changes while retaining focus and form values.
Native Solid/HTML attributes remain available and are omitted from this authored-prop view.