Checkbox Field
Combines a Checkbox with a Label and InlineMessage
CheckboxField
renders a Checkbox
inside an InlineFieldWrapper
, providing a consistent layout for a checkbox, label and, when applicable, an error.
<Form><CheckboxField label="Do you like checkboxes?" name="likeCheckboxes" /></Form>
API Reference
Prop | Type | Default | Required |
---|---|---|---|
defaultChecked | boolean |
| - |
asChild | boolean | - | - |
checked | boolean | - | - |
required | boolean | - | - |
onCheckedChange | (checked: CheckedState) => void | - | - |
state | "error" | - | - |
css | CSSProperties | - | - |
label | string | - | |
error | string | - | - |
prompt | { link: string; label: string; } | - | - |
description | string | - | - |
hideLabel | boolean | - | - |
validation | ValidationOptions | - | - |