API reference: @salmonui/inputs/color-picker
ColorFieldPropsinterface
import type { ColorFieldProps } from '@salmonui/inputs/color-picker';interface ColorFieldProps extends FieldCommonProps, NativeInput {
readonly value?: ColorInput | null | undefined;
readonly defaultValue?: ColorInput | null | undefined;
readonly onValueChange?: ((value: string | null, details: ColorFieldChangeDetails) => void) | undefined;
readonly valueFormat?: ColorFormat | undefined;
readonly clearable?: boolean | undefined;
readonly showSwatch?: boolean | undefined;
readonly endAdornment?: ReactNode;
readonly localeText?: (FieldValidationText & {
readonly clear?: string;
readonly colorName?: (color: Color) => string;
}) | undefined;
readonly className?: string | undefined;
readonly style?: CSSProperties | undefined;
readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
} | undefined;
readonly ref?: Ref<HTMLInputElement> | undefined;
}
| Name | Signature | Description |
|---|---|---|
valueoptional | readonly value?: ColorInput | null | undefined; | |
defaultValueoptional | readonly defaultValue?: ColorInput | null | undefined; | |
onValueChangeoptional | readonly onValueChange?: ((value: string | null, details: ColorFieldChangeDetails) => void) | undefined; | Called with the entry in |
valueFormatoptional | readonly valueFormat?: ColorFormat | undefined; | Format of the shown and reported value. Default |
clearableoptional | readonly clearable?: boolean | undefined; | |
showSwatchoptional | readonly showSwatch?: boolean | undefined; | A |
endAdornmentoptional | readonly endAdornment?: ReactNode; | |
localeTextoptional | readonly localeText?: (FieldValidationText & {
readonly clear?: string;
readonly colorName?: (color: Color) => string;
}) | undefined; | |
classNameoptional | readonly className?: string | undefined; | |
styleoptional | readonly style?: CSSProperties | undefined; | |
classNamesoptional | readonly classNames?: {
readonly group?: string;
readonly input?: string;
readonly label?: string;
readonly description?: string;
readonly error?: string;
} | undefined; | |
refoptional | readonly ref?: Ref<HTMLInputElement> | undefined; | The native |
labeloptionalinherited | label?: ReactNode; | |
descriptionoptionalinherited | description?: ReactNode; | |
errorMessageoptionalinherited | errorMessage?: ((ctx: { readonly errors: readonly string[]; }) => ReactNode) | ReactNode; | Error text (or a function of the errors) shown while the field is invalid. |
invalidoptionalinherited | invalid?: boolean; | Forces the error state. |
validationoptionalinherited | validation?: FieldValidation; | Rules in the Data Grid vocabulary. |
validateOnoptionalinherited | validateOn?: ValidateOn; | When errors appear; default the |
sizeoptionalinherited | size?: FieldSize; | Metric set. Default |