Checkbox and Select Inputs
CheckboxInput and SelectInput provide the input-level controls used by Payload's Checkbox and Select fields. They are useful when a Custom Field needs standard Admin styling while controlling its own state.
Import
CheckboxInput
Use checked and onToggle to control the value. Set partialChecked to display the indeterminate treatment used by list-selection interfaces.
SelectInput
SelectInput wraps ReactSelect with Payload's field label, description, and validation structure. Its controlled value contains the stored option value rather than the complete option object.
CheckboxInput props
Prop | Type | Default | Description |
|---|---|---|---|
| | | Controls the checked state. |
| | — | Receives changes from the native checkbox. |
| | — | Displays the checkbox label. |
| | | Displays the indeterminate treatment. |
| | | Disables interaction. |
| | | Marks the native input as required. |
SelectInput props
Prop | Type | Default | Description |
|---|---|---|---|
| | — | Names the select input. |
| | — | Identifies the field and connects its UI. |
| | — | Supplies the available translated options. |
| | — | Supplies the selected stored value or values. |
| | — | Receives the selected option object. |
| | | Enables multiple values. |
| | | Enables reordering in multi-value mode. |
| | | Allows the selected value to be cleared. |
| | | Disables interaction. |
| | Form | Displays the current validation error. |
* An asterisk denotes that a prop is required.
Provider requirements
Both inputs use Payload's translation context. SelectInput also composes the standard field label, description, and error components, which can read the surrounding form context in a Custom Field.
Was this page helpful?