Skip to content

Early previewhamur is not on npm yet. The components are being built in the open, follow along on GitHub.

UIComponentsReact

Checkbox Group

Checkboxes that share one value: the list of the ticked ones.

Built on the headless Checkbox Group.See its API in Docs

Rendered by React 19.3.1

checkbox-group.tsx

Installation

npx shadcn@4.23.0 add https://hamur.dev/r/react/checkbox-group.json

It also adds utils. The app needs its setup first: Installation.

Usage

Give the group value or defaultValue (the ticked names) and give each Checkbox a name; a parent checkbox can tick them all, as the headless docs show.

import { CheckboxGroup } from '@/components/ui/checkbox-group'

Examples

Default

Three options in a group.

Its preview and code are at the top of the page.

shadcn/ui has no Checkbox Group, so this item takes Base UI's component ID as its slug and one name per Base UI part. Its options are the Checkbox item's checkboxes.

API reference

The styled parts pass every prop to the headless part they wrap and add classes. The props, data attributes and keyboard are on Checkbox Group's API reference.