Skip to main contentCarbon Design System

Slider

The following page documents visual specifications such as color, typography, structure, and size.

Color

ElementPropertyColor token
Handlefill$icon-primary
Trackbackground-color$border-subtle *
Track: filledbackground-color$border-inverse
Labeltext-color$text-secondary
Rangel labeltext-color$text-primary

* Denotes a contextual color token that will change values based on the layer it is placed on.

Default slider color enabled state

Interactive states

Slider uses a number input to type in values. See number input for more information on its interactive states.

StateElementPropertyColor token
FocusHandleborder$focus
Trackbackground-color$interactive
ActiveHandlefill$interactive
Trackbackground-color$interactive
ErrorNumber inputborder$support-error
Error iconsvg$support-error
Error messagetext-color$text-error
WarningWarning iconsvg$support-warning
Warning messagetext-color$text-primary
DisabledLabeltext-color$text-disabled
Range labeltext-color$text-disabled
Handlefill$border-disabled
Trackbackground-color$border-disabled
Read-onlyLabeltext-color$text-secondary
Range labeltext-color$text-primary
Trackbackground-color$border-subtle *
Track: filledbackground-color$border-inverse

* Denotes a contextual color token that will change values based on the layer it is placed on.

Default slider interactive states

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.

ElementFont-size (px/rem)Font-weightType token
Label12 / 0.75Regular / 400$label-01
Range label14 / 0.875Regular / 400$body-compact-01

Structure

The width of a slider varies based on page content and layout.

Default slider structure

ElementPropertypx / remSpacing token
Handleheight, width14 / 0.875
Handle: activeheight, width20 / 1.25
Trackheight4 / 0.25
margin-left, margin-right8 / 0.5$spacing-03
Labelmargin-bottom8 / 0.5$spacing-03
Range labelmargin-right16 / 1$spacing-05
Error messagemargin-top16 / 1$spacing-05
Error iconpadding-right, padding-left16 / 1$spacing-05
Tooltippadding-bottom4 / 0.25$spacing-02
Structure and spacing measurements for default slider enabled state
Structure and spacing measurements for default slider error state
Structure and spacing measurements for default sliders with tooltips and no number inputs

Range slider structure

ElementPropertypx / remSpacing token
Handleheight, width16 / 1$spacing-05
Handle: activeheight, width16 / 1$spacing-05
Trackheight4 / 0.25
margin-left, margin-right16 / 1$spacing-05
Labelmargin-bottom8 / 0.5$spacing-03
Range labelmargin-right16 / 1$spacing-05
Error messagemargin-top16 / 1$spacing-05
Error iconpadding-right, padding-left16 / 1$spacing-05
Tooltippadding-bottom0
Structure and spacing measurements for range slider enabled state
Structure and spacing measurements for range slider error state
Structure and spacing measurements forrange sliders with tooltips and no number inputs

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.

ElementPropertypx / remSpacing token
Slidermin-width200 / 12.5
max-width640 / 40

Feedback

Help us improve this component by providing feedback, asking questions, and leaving any other comments on GitHub.