Binhlaig UI Component
Checkbox
A compact control for selecting one or more options, with checked, unchecked and indeterminate states.
Installation
Initialize Binhlaig UI and install Checkbox with your preferred installer.
Initialize first
npx binhlaig-ui@latest initTerminal
npx binhlaig-ui@latest add checkbox --installer nativeImport
Import Checkbox from your UI directory.
import { Checkbox } from "@/components/ui/checkbox"Usage
Wrap Checkbox and its text in a label for accessible naming.
States
Checkbox supports checked, unchecked, indeterminate and disabled states.
Controlled State
Control the checked state with React.
State: unchecked
Form Example
Use name and required for native form submission.
Update or Overwrite
Replace an older Checkbox source with the latest registry version.
npx binhlaig-ui@latest add checkbox --installer native --overwriteAPI Reference
Checkbox supports Base UI Root props and its three selection states.
| Prop | Values | Default |
|---|---|---|
checked | boolean | indeterminate | undefined |
defaultChecked | boolean | false |
onCheckedChange | function | — |
disabled | boolean | false |
required | boolean | false |
name | string | undefined |