Skip to content

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>
PropTypeDefaultDescription
value(instance: TCommand) => unknownRequired. Accessor function that returns the bound property from the command instance. Pass the command type as the generic parameter for full type safety.
labelstringText displayed inline next to the checkbox.
  • Default value is false.
  • Validation state is reflected via the PrimeReact invalid flag on the checkbox.