A color slider allows users to visually change an individual channel of a color.
Color sliders can be either in horizontal or vertical orientation. By default, a color slider is horizontal and should be used when vertical space is more limited. The vertical orientation is used when horizontal space is more limited.
The color slider can be used to select hues, color channel values (such as RGB or CMYK levels), or opacity.
While the color slider has a fixed thickness (24 px on desktop, 30 px on mobile), the length of the color slider is flexible and can be customized to appropriately fit its context. The minimum length is 80 px on desktop scale and 100 px on mobile scale.
Unlike the slider itself, the color slider’s handle can slide all the way to the edge of the track. It always displays the selected color inside the handle and never gets cut off by the track or any container.
On down (touch), a loupe appears above the handle to show the selected color that would otherwise be covered by the finger. This only appears on finger input, not mouse or stylus. It appears 10 px above the edge of the handle on desktop scale and 8 px on mobile scale.
Color sliders should be labeled and, when applicable, be accompanied by text fields. In a context when labeling each individual slider may be redundant, make sure to still label the group of sliders (“RGB,” “HSB,” etc.)
When using color areas, it’s important to clearly display the color selection in real-time. It can be in a color swatch, or directly on the canvas, or both.
|Tab||Places focus on the handle. If the handle is already in focus, moves focus to the next handle or next element in the page tab sequence.|
|Shift + Tab||Places focus on the previous handle or previous element in the page tab sequence.|
|Up, Down, Left, or Right Arrow||Moves the handle up/down/left/right.|
|Mar 26, 2020||1.0.1|
|Apr 19, 2019||1.0.0|
Includes all interactive states that are applicable (hover, down, focus, keyboard focus, disabled).
Includes relevant options (variant, style, size, orientation, optional iconography, decorations, selection, error state, etc.)
Works properly across all four color themes (lightest, light, dark, darkest).
Includes a desktop scale (UWP, macOS, web desktop) and a mobile scale (iOS, Android, web mobile).
Includes guidelines for layout (wrapping, truncation, overflow), animation, interactions, etc.
Includes a list of dos and don’ts that highlight best practices and common mistakes.
Follows WCAG 2.0 standards for contrast (AA).
Works properly across various locales and includes guidelines for bi-directionality (RTL).
Follows WCAG 2.0 standards for keyboard accessibility guidelines and includes a description of the keyboard interactions.
Includes a downloadable XD file that has been generated by code and shows multiple variations, states, color themes, and scales.
All design attributes (color, typography, layout, animation, etc.) are included in Spectrum DNA.