Foundation ComponentReact 18 & 19Zero Runtime CSS
Checkbox
One native input. Form submission, validation and keyboard support included.
Interactive preview
Usage
import { Checkbox, Label } from "@devvy-ui/react";
<Label><Checkbox name="terms" required /> Accept terms</Label>API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| checked / defaultChecked | boolean | false | Controlled or initial checked state. |
| indeterminate | boolean | false | Mixed state; does not determine submission value. |
| onChange | ChangeEventHandler | — | Native change event. |
| disabled | boolean | false | Disables the control. |
Accessibility & behavior
Platform Behavior & Guidelines
Space toggles the checkbox. Mixed state uses aria-checked and the native indeterminate property after hydration. Manage that prop when implementing select-all behavior.
Source ownership
Add the audited implementation directly into your repository with the CLI:
node /path/to/devvy-ui/packages/cli/src/cli.mjs add checkboxMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Checkbox.tsxREACT / TSX
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.