Skip to content

ColorPickerField

ColorPickerField wraps the PrimeReact ColorPicker component for selecting colors.

import { CommandDialog } from '@cratis/components/CommandDialog';
import { ColorPickerField } from '@cratis/components/CommandForm';
<CommandDialog command={MyCommand} visible={visible} onCancel={() => setVisible(false)}>
<ColorPickerField<MyCommand>
value={c => c.primaryColor}
title="Primary color"
/>
</CommandDialog>
PropTypeDefaultDescription
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.
inlinebooleanfalseRenders the picker inline instead of using an overlay.
defaultColorstring000000Fallback color used when the bound value is empty.
  • Default value is an empty string.
  • Values are persisted as color strings (hex format in the default PrimeReact mode).
  • Validation state is reflected by applying the p-invalid class when the field is invalid.