Forms
Checkbox
A yes or no that applies when the form is saved.
Installation
pnpm add @elsikora/keystone-ui-kitUsage
import { Checkbox } from "@elsikora/keystone-ui-kit";import { Checkbox, Field } from "@elsikora/keystone-ui-kit";
export default function CheckboxDefaultExample() { return ( <Field label="I have read the release notes" orientation="horizontal"> <Checkbox /> </Field> );}Examples
Default
Checked and disabled
API reference
Checkbox
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | "indeterminate" | - | The state, when the caller holds it. |
defaultChecked | boolean | - | The first state, when the component holds it. |
onCheckedChange | (checked: boolean | "indeterminate") => void | - | Called when it changes. |
disabled | boolean | false | Unavailable. |
Notes
- Its hit area is 44 px though the box is smaller.