Checkbox
This component is basically just a wrapper for
<input type="checkbox" />
. You'll probably want to use it along with a <label>
. You also might prefer to use RFUI's FormField
component with type="checkbox"
instead.import { Checkbox } from "rfui-package";
Basic
<Checkbox />
Controlled
<Checkbox checked={checked} onClick={onClick} />
Size
Set
size
to "sm"
, "md"
, or "lg"
. Defaults to "md"
.<Stack className="gap-5">
<Checkbox size="sm" />
<Checkbox size="md" />
<Checkbox size="lg" />
</Stack>
Disabled
Set
disabled
to either true
or false
. Defaults to false
.<Checkbox disabled />
Invalid
Set
invalid
to either true
or false
. Defaults to false
.<Checkbox invalid />
Props
Prop | Required | Default | Type and notes |
---|---|---|---|
size | - | "md" |
|
invalid | - | "md" |
|
...rest | - | - |
See the docs for rest parameters. For Checkbox , you could pass anything you normally would pass to <input type="checkbox" /> because the return value looks something like this:
|