API reference: @salmonui/inputs/color-picker
ColorSlidercomponent
import { ColorSlider } from '@salmonui/inputs/color-picker';function ColorSlider(props: ColorSliderProps): ReactNode;
One channel of a color: a CSS-gradient
track with a thumb over a visually hidden range input (APG Slider).
aria-valuetext names the hue ("120°, green") or the opacity ("50%").
Horizontal sliders mirror in right-to-left content, keys included.
Props: ColorSliderProps
| Name | Signature | Description |
|---|---|---|
channel | readonly channel: 'hue' | 'alpha'; | The channel: |
orientationoptional | readonly orientation?: 'horizontal' | 'vertical' | undefined; | Default |
stepoptional | readonly step?: number | undefined; | Arrow key step in channel units; Shift and Page keys use ten times it. Default 1. |
refoptional | readonly ref?: Ref<HTMLDivElement> | undefined; | The root element. |
valueoptionalinherited | value?: ColorInput; | Controlled color: a string or a |
defaultValueoptionalinherited | defaultValue?: ColorInput; | |
onValueChangeoptionalinherited | onValueChange?: ((color: Color, details: ColorChangeDetails) => void); | Every change; during a pointer drag at most once per animation frame. |
onValueCommitoptionalinherited | onValueCommit?: ((color: Color, details: ColorChangeDetails) => void); | The end of a drag, and every keyboard step. |
nameoptionalinherited | name?: string; | Name of a hidden input carrying the color in |
formoptionalinherited | form?: string; | |
valueFormatoptionalinherited | valueFormat?: ColorFormat; | Format of the hidden input value. Default |
disabledoptionalinherited | disabled?: boolean; | |
localeTextoptionalinherited | localeText?: ColorPartLocaleText; | |
classNameoptionalinherited | className?: string; | |
styleoptionalinherited | style?: CSSProperties; | |
aria-labeloptionalinherited | aria-label?: string; | |
aria-labelledbyoptionalinherited | aria-labelledby?: string; | |
idoptionalinherited | id?: string; |