Components · Form Controls
Checkbox Field
AlphaAdded v11.1.0
A Checkbox with its label, description, aside and error; CheckboxGroupField puts several under one question.
import { CheckboxField } from '@nexub/react';Playground
Props
Paper and ribbon
$4.00<CheckboxField label="Gift wrap" description="Paper and ribbon" aside="$4.00" />Examples
Field
Group
States
Paper and ribbon
$4.00defaultPaper and ribbon
$4.00invalidPaper and ribbon
$4.00readOnlyPaper and ribbon
$4.00size="sm"Paper and ribbon
$4.00size="md"Paper and ribbon
$4.00size="lg"
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| labelrequired | React.ReactNode | — | Names the box; clicking it toggles. |
| description | React.ReactNode | — | Help under the label and the error under the row. |
| error | React.ReactNode | — | Help under the label and the error under the row. |
| aside | React.ReactNode | — | At the row end: a price, a count. |
| checked | boolean | 'indeterminate' | — | As Checkbox; indeterminate for a parent of a partly picked list. |
| CheckboxGroupField optionsrequired | CheckboxGroupOption[] | — | The choices, with value / onValueChange (string[]), orientation, required, name and one error for the group. |
| invalid | boolean | — | Error border and aria-invalid. |
| readOnly | boolean | — | Focusable but cannot change; sets aria-readonly. |
| size | 'sm' | 'md' | 'lg' | — | Box size: sm 16px, md 18px (default), lg 20px. |
Accessibility
Notes
CheckboxGroupField is a `fieldset` named by its legend; its error describes the group and marks every box invalid.
On iOS & Android: CheckboxField
@nexub/react-nativeAlpha
import { CheckboxField } from '@nexub/react-native';
<CheckboxField label="I agree to the terms" checked={agreed} onCheckedChange={setAgreed} />Web vs mobile
Same tokens and prop names. Where the platforms differ:
| Web | iOS & Android | |
|---|---|---|
| Groups | CheckboxGroupField. | CheckboxGroupField too, with options. |
Interactive preview of @nexub/react-native rendered for the web. Native chrome (switches, pickers, Liquid Glass) looks like the platform on a device.
On device

iPhone (iOS simulator)

Pixel (Android emulator)
Screenshots from the latest CI run of the showcase app; the live frame renders the same code for the web.
CheckboxField props
| Prop | Type | Default | Description |
|---|---|---|---|
| error | string | — | The error under the field; also marks the checkbox invalid. |
| aside | React.ReactNode | — | At the row's end: a price, a count. |
| labelrequired | string | — | — |
| checked | boolean | — | — |
| defaultChecked | boolean | false | — |
| onCheckedChange | (checked: boolean) => void | — | — |
| description | string | — | — |
| disabled | boolean | — | — |
| size | Extract<ControlSize, 'sm' | 'md' | 'lg'> | 'md' | Box and label size, the same names as web Checkbox: sm, md, lg. |
| invalid | boolean | — | Red box and announced as invalid. |
| readOnly | boolean | — | Can be focused and read but not changed: pressing it does nothing. |
| style | StyleProp<ViewStyle> | — | — |