Components/Checkbox
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 init
Terminal
npx binhlaig-ui@latest add checkbox --installer native

Import

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 --overwrite

API Reference

Checkbox supports Base UI Root props and its three selection states.

PropValuesDefault
checkedboolean | indeterminateundefined
defaultCheckedbooleanfalse
onCheckedChangefunction—
disabledbooleanfalse
requiredbooleanfalse
namestringundefined