One channel of a color chosen along a track drawn with its colors, following the APG's slider pattern, in each framework.
Choose one channel of a color along a track drawn with that channel's colors (WAI-ARIA APG
slider). Its value is a
color in rgb, hsl or hsb; the channel is the thumb's aria-valuenow,
and its text ("120°", "50%") comes from Intl. It works in a native <form> and a
Field.
Value: a Color or a string ("#336699", "hsl(210, 50%, 40%)"); changes report a
Color in the slider's space: colorSpace, else the value's own when it has the channel,
else the channel's own (red, green, blue: rgb; lightness: hsl; hue, saturation, brightness:
hsb). Several sliders can share one value, each editing its channel.
Range: the channel's (hue 0–360, saturation, lightness and brightness 0–100, red, green and
blue 0–255, alpha 0–1), its step and large step; values snap to the step.
Track: the interactive area. A press moves the thumb there (reason track-press), focuses
it and drags it with pointer capture (drag, data-dragging). It sets
--color-slider-track-background (a CSS linear-gradient of the channel), and the Thumb
--color-slider-thumb-color; draw with them (background: var(--color-slider-track-background)).
Commit: onValueCommit once a drag ends, or after a key changed the value.
Label: names the Root and the Thumb (when it has no name of its own); a press on it focuses
the Thumb. No channel name of its own: the library renders no text.
Output: an output for the Thumb showing the channel's text, or the content you give it.
RTL: a horizontal slider runs right to left, the arrows swap and the gradient runs to left.
Forms: a hidden input submits the color as hex (#rrggbb, or #rrggbbaa below full
alpha), whatever the channel.
Every part also takes what the primitive contract gives:
render (Vue: as and the render slot), a class and a style, a ref, and any attribute, which
it forwards. The names below are React's; Vue binds them the same way (v-model:value,
@value-commit), and Angular as inputs and outputs ([(value)], (valueCommit)).