Slider
The following page documents visual specifications such as color, typography, structure, and size.
Color
Element | Property | Color token |
---|---|---|
Handle | fill |
|
Track | background-color |
|
Track: filled | background-color |
|
Label | text-color |
|
Rangel label | text-color |
|
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Default slider color enabled state](/static/281f3e279c6a2287174046ecf9a4d65c/3cbba/color-default-slider.png)
![Range slider color enabled state](/static/12fbd021177893e8f523f5d6e2f63ca9/3cbba/color-range-slider.png)
Interactive states
Slider uses a number input to type in values. See number input for more information on its interactive states.
State | Element | Property | Color token |
---|---|---|---|
Focus | Handle | border |
|
Track | background-color |
| |
Active | Handle | fill |
|
Track | background-color |
| |
Error | Number input | border |
|
Error icon | svg |
| |
Error message | text-color |
| |
Warning | Warning icon | svg |
|
Warning message | text-color |
| |
Disabled | Label | text-color |
|
Range label | text-color |
| |
Handle | fill |
| |
Track | background-color |
| |
Read-only | Label | text-color |
|
Range label | text-color |
| |
Track | background-color |
| |
Track: filled | background-color |
|
* Denotes a contextual color token that will change values based on the layer it is placed on.
![Default slider interactive states](/static/940a593fa2aecfcda4cafbf6c833f6df/3cbba/slider-default-style-states.png)
![Range slider interactive states](/static/cf7ae283e84367b5e5c7559fa813e716/3cbba/slider-range-style-states.png)
Typography
Slider labels should be set in sentence case, with only the first word in a phrase and any proper nouns capitalized, and no more than three words.
Element | Font-size (px/rem) | Font-weight | Type token |
---|---|---|---|
Label | 12 / 0.75 | Regular / 400 |
|
Range label | 14 / 0.875 | Regular / 400 |
|
Structure
The width of a slider varies based on page content and layout.
Default slider structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Handle | height, width | 14 / 0.875 | – |
Handle: active | height, width | 20 / 1.25 | – |
Track | height | 4 / 0.25 | – |
margin-left, margin-right | 8 / 0.5 |
| |
Label | margin-bottom | 8 / 0.5 |
|
Range label | margin-right | 16 / 1 |
|
Error message | margin-top | 16 / 1 |
|
Error icon | padding-right, padding-left | 16 / 1 |
|
Tooltip | padding-bottom | 4 / 0.25 |
|
![Structure and spacing measurements for default slider enabled state](/static/f694eb1e1c86337047a9cebb79fb5828/3cbba/slider-style-structure-default-enabled.png)
![Structure and spacing measurements for default slider error state](/static/033ab17e7bb43fe3611ece44833359aa/3cbba/slider-style-structure-default-error.png)
![Structure and spacing measurements for default sliders with tooltips and no number inputs](/static/ab97fe18bfefb81743e8c05aaf2c1dac/3cbba/slider-style-structure-default-tooltip.png)
Range slider structure
Element | Property | px / rem | Spacing token |
---|---|---|---|
Handle | height, width | 16 / 1 |
|
Handle: active | height, width | 16 / 1 |
|
Track | height | 4 / 0.25 | – |
margin-left, margin-right | 16 / 1 |
| |
Label | margin-bottom | 8 / 0.5 |
|
Range label | margin-right | 16 / 1 |
|
Error message | margin-top | 16 / 1 |
|
Error icon | padding-right, padding-left | 16 / 1 |
|
Tooltip | padding-bottom | 0 | – |
![Structure and spacing measurements for range slider enabled state](/static/f694eb1e1c86337047a9cebb79fb5828/3cbba/slider-style-structure-default-enabled.png)
![Structure and spacing measurements for range slider error state](/static/033ab17e7bb43fe3611ece44833359aa/3cbba/slider-style-structure-default-error.png)
![Structure and spacing measurements forrange sliders with tooltips and no number inputs](/static/d212221a6b1891161fe0cb74c0cb6a0d/3cbba/slider-style-structure-range-tooltip.png)
Size
The following specs are not built into the slider component but are recommended by design as the proper sizing for the slider tracking line.
Element | Property | px / rem | Spacing token |
---|---|---|---|
Slider | min-width | 200 / 12.5 | – |
max-width | 640 / 40 | – |
Feedback
Help us improve this component by providing feedback, asking questions, and leaving any other comments on GitHub.