🚀ReacUI is currently in Beta. We're actively improving it! ❣️
Checkbox
A checkbox component for selecting multiple options from a set
Installation
The Checkbox component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the Checkbox component into your React component.
Basic Usage
The Checkbox component provides a styled checkbox input.
With Labels
Combine checkboxes with labels for better accessibility and user experience.
Checkbox States
Checkboxes can be in different states such as checked or disabled.
In Forms
Use checkboxes in forms to collect multiple selections.
Notification Preferences
API Reference
The following props are available for the Checkbox component.
| Prop | Type | Default | Description |
|---|---|---|---|
| id | string | undefined | ID for the checkbox input, useful for linking with labels |
| checked | boolean | undefined | Controlled checked state of the checkbox |
| defaultChecked | boolean | false | Initial checked state for uncontrolled checkbox |
| disabled | boolean | false | Whether the checkbox is disabled |
| onChange | function | undefined | Function called when checkbox state changes |
| className | string | '' | Additional CSS classes to apply to the checkbox |