CheckboxField
CheckboxField provides a boolean toggle backed by the PrimeReact Checkbox component.
import { CommandDialog } from '@cratis/components/CommandDialog';import { CheckboxField } from '@cratis/components/CommandForm';
<CommandDialog command={MyCommand} visible={visible} onCancel={() => setVisible(false)}> <CheckboxField<MyCommand> value={c => c.isActive} label="Active" /> <CheckboxField<MyCommand> value={c => c.newsletter} label="Send me newsletter updates" /></CommandDialog>| Prop | Type | Default | Description |
|---|---|---|---|
value | (instance: TCommand) => unknown | — | Required. Accessor function that returns the bound property from the command instance. Pass the command type as the generic parameter for full type safety. |
label | string | — | Text displayed inline next to the checkbox. |
Behavior
Section titled “Behavior”- Default value is
false. - Validation state is reflected via the PrimeReact
invalidflag on the checkbox.