Checkbox
Form checkbox input. Single and indeterminate states.
Examples
Default
Checked
Disabled
Group
Multiple checkboxes forming a selection group.
Card Selection
Checkboxes styled as selectable cards.
With Description
Checkbox with label and supporting description text.
Installation
pnpm add @rokle/components @rokle/tokensInstalls with the default Rokle brand. Generate a custom brand on rokle.app to use your own colours and personality.
Usage
import { Checkbox } from "@rokle/components";import { Checkbox } from "@rokle/components";
export function Example() {
return (
<div className="flex flex-col gap-3">
<label className="flex items-center gap-2">
<Checkbox /> Accept terms and conditions
</label>
<label className="flex items-center gap-2">
<Checkbox defaultChecked /> Receive email updates
</label>
<label className="flex items-center gap-2">
<Checkbox disabled /> Disabled option
</label>
</div>
);
}Source
The implementation source for this component. Copy it into your project and customise.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| checked | boolean | false | Checked state. |
| disabled | boolean | false | Disable interaction. |