Slider
Slider handles horizontal and vertical range input, inset icons, value indicators, and directional layouts with keyboard-friendly behavior.
The value indicator is rendered as a manual popover so it stays in the browser top layer instead of being clipped by parent overflow. Its animated position is driven by Slider CSS variables and transform-style movement; avoid overriding the animated --percent path from app code.
Anatomy
| Element | Part | Selector |
|---|---|---|
<div> | root | [data-scope="slider"][data-part="root"]LMBCopy |
<div> | track-active | [data-scope="slider"][data-part="track-active"]LMBCopy |
<div> | track-inactive | [data-scope="slider"][data-part="track-inactive"]LMBCopy |
<div> | handle | [data-scope="slider"][data-part="handle"]LMBCopy |
<div> | value-indicatorconditional | [data-scope="slider"][data-part="value-indicator"]LMBCopy |
<span> | value-indicator-text | [data-scope="slider"][data-part="value-indicator-text"]LMBCopy |
Props
| Name | Description | Default | Control |
|---|---|---|---|
verticalOptional | Whether the slider is vertical. boolean | undefined | false | |
directionOptional | The direction of the slider. ltrrtl | "ltr" | |
minRequired | The minimum value of the slider. number | - | |
maxRequired | The maximum value of the slider. number | - | |
stepRequired | The step value of the slider. number | - | |
wheelStepOptional | The amount the value changes when using the mouse wheel. number | undefined | - | |
lowerLimitOptional | The lower limit for the slider value. number | undefined | - | |
upperLimitOptional | The upper limit for the slider value. number | undefined | - | |
sizeOptional | The size of the slider. smalllargeextra-smallmediumextra-large | "medium" | |
startIconOptional | Name of the inset icon shown at the start side of the track. string | undefined | - | |
endIconOptional | Name of the inset icon shown at the end side of the track. string | undefined | - | |
disabledOptional | - boolean | undefined | false | |
valueIndicatorOptional | - boolean | undefined | true | |
valueIndicatorPlacementOptional | - startendbottomtop | - | |
formatterOptional | - { valueToText: (value: number) => string; textToValue: (text?: string | undefined) => number | undefined; } | undefined | - | - |
stopIndicatorsOptional | - number[] | undefined | - | |
valueRequired | - number | - |
Events1
| Name | Type | Description |
|---|---|---|
update:value | [value: number] | - |
Slots0
No slots documented.
Styling7
| Token | Description |
|---|---|
--md-slider-active-track-colorColorFallback var(--md-sys-color-primary) | Controls active track color. |
--md-slider-inactive-track-colorColorFallback var(--md-sys-color-primary-container) | Controls inactive track color. |
--md-slider-handle-colorColorFallback var(--md-sys-color-primary) | Controls handle color. |
--md-slider-active-icon-colorColorFallback var(--md-sys-color-on-primary) | Controls icon color on the active track. |
--md-slider-inactive-icon-colorColorFallback var(--md-sys-color-primary) | Controls icon color on the inactive track. |
--md-slider-value-indicator-backgroundColorFallback var(--md-sys-color-inverse-surface) | Controls value indicator container color. |
--md-slider-value-indicator-colorColorFallback var(--md-sys-color-inverse-on-surface) | Controls value indicator label color. |