Checkbox
A customizable checkbox component that supports labels, indeterminate state, and disabled states.
Installation
Import the component:
import Checkbox from "@/components/ui/checkbox"
Basic Usage
Checkboxes allow users to select multiple options from a set. Each checkbox can be checked or unchecked independently.
Indeterminate
The indeterminate state is useful for showing a partially checked state, commonly used in 'select all' scenarios.
Disabled
Checkboxes can be disabled to prevent user interaction.
Props
Prop
Type
Default
Description
nameRequiredstring—
Name of the checkbox
labelstring—
Label text for the checkbox
checkedboolean—
Whether the checkbox is checked
indeterminateboolean—
Whether the checkbox is in an indeterminate state
disabledboolean—
Whether the checkbox is disabled
classNamestring—
Additional CSS classes
onChangefunction—
Callback when checkbox state changes