View as Markdown

API reference: @salmonui/inputs/color-picker

ColorPartPropsinterface

import type { ColorPartProps } from '@salmonui/inputs/color-picker';
interface ColorPartProps {
    readonly value?: ColorInput | undefined;
    readonly defaultValue?: ColorInput | undefined;
    readonly onValueChange?: ((color: Color, details: ColorChangeDetails) => void) | undefined;
    readonly onValueCommit?: ((color: Color, details: ColorChangeDetails) => void) | undefined;
    readonly name?: string | undefined;
    readonly form?: string | undefined;
    readonly valueFormat?: ColorFormat | undefined;
    readonly disabled?: boolean | undefined;
    readonly localeText?: ColorPartLocaleText | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
    readonly 'aria-labelledby'?: string | undefined;
    readonly id?: string | undefined;
}

Props shared by ColorArea and ColorSlider.

ColorPartProps members (14)
NameSignatureDescription
valueoptionalreadonly value?: ColorInput | undefined;

Controlled color: a string or a Color (a Color keeps the hue of grays).

defaultValueoptionalreadonly defaultValue?: ColorInput | undefined;
onValueChangeoptionalreadonly onValueChange?: ((color: Color, details: ColorChangeDetails) => void) | undefined;

Every change; during a pointer drag at most once per animation frame.

onValueCommitoptionalreadonly onValueCommit?: ((color: Color, details: ColorChangeDetails) => void) | undefined;

The end of a drag, and every keyboard step.

nameoptionalreadonly name?: string | undefined;

Name of a hidden input carrying the color in valueFormat.

formoptionalreadonly form?: string | undefined;
valueFormatoptionalreadonly valueFormat?: ColorFormat | undefined;

Format of the hidden input value. Default 'hexa'.

disabledoptionalreadonly disabled?: boolean | undefined;
localeTextoptionalreadonly localeText?: ColorPartLocaleText | undefined;
classNameoptionalreadonly className?: string | undefined;
styleoptionalreadonly style?: CSSProperties | undefined;
aria-labeloptionalreadonly 'aria-label'?: string | undefined;
aria-labelledbyoptionalreadonly 'aria-labelledby'?: string | undefined;
idoptionalreadonly id?: string | undefined;