Skip to content

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

UIComponentsReact

Checkbox

A box the reader ticks on or off.

Built on the headless Checkbox.See its API in Docs

Rendered by React 19.3.1

checkbox.tsx

Installation

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

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

Usage

It is the headless Checkbox: checked or defaultChecked, its change event and indeterminate work as the headless docs show. Name it with a Label pointing at its id, or aria-label.

import { Checkbox } from '@/components/ui/checkbox'

Examples

Default

A checkbox with its label.

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

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's API reference.