View as Markdown

API reference: @salmonui/inputs/color-picker

ColorSliderPropsinterface

import type { ColorSliderProps } from '@salmonui/inputs/color-picker';
interface ColorSliderProps extends ColorPartProps {
    readonly channel: 'hue' | 'alpha';
    readonly orientation?: 'horizontal' | 'vertical' | undefined;
    readonly step?: number | undefined;
    readonly ref?: Ref<HTMLDivElement> | undefined;
}
ColorSliderProps members (18, 14 inherited)
NameSignatureDescription
channelreadonly channel: 'hue' | 'alpha';

The channel: 'hue' (0-360 degrees) or 'alpha' (0-100 percent).

orientationoptionalreadonly orientation?: 'horizontal' | 'vertical' | undefined;

Default 'horizontal'; vertical sliders grow upward and never mirror.

stepoptionalreadonly step?: number | undefined;

Arrow key step in channel units; Shift and Page keys use ten times it. Default 1.

refoptionalreadonly ref?: Ref<HTMLDivElement> | undefined;

The root element.

valueoptionalinheritedvalue?: ColorInput;

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

defaultValueoptionalinheriteddefaultValue?: ColorInput;
onValueChangeoptionalinheritedonValueChange?: ((color: Color, details: ColorChangeDetails) => void);

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

onValueCommitoptionalinheritedonValueCommit?: ((color: Color, details: ColorChangeDetails) => void);

The end of a drag, and every keyboard step.

nameoptionalinheritedname?: string;

Name of a hidden input carrying the color in valueFormat.

formoptionalinheritedform?: string;
valueFormatoptionalinheritedvalueFormat?: ColorFormat;

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

disabledoptionalinheriteddisabled?: boolean;
localeTextoptionalinheritedlocaleText?: ColorPartLocaleText;
classNameoptionalinheritedclassName?: string;
styleoptionalinheritedstyle?: CSSProperties;
aria-labeloptionalinheritedaria-label?: string;
aria-labelledbyoptionalinheritedaria-labelledby?: string;
idoptionalinheritedid?: string;