
More components in Pro
Galleries, cards and interactive pieces for pages that need more than the basics.
value | Controlled value. Pair it with onChange. | ||
defaultValue | 50 | Starting value when uncontrolled. | |
startingValue | Lowest value of the range. | ||
maxValue | 100 | Highest value of the range. | |
isStepped | Snaps the value to stepSize increments. | ||
stepSize | Size of each step when isStepped is on. | ||
onChange | (value: number) => void | Called as the value changes. | |
onChangeEnd | (value: number) => void | Called when a drag, key press or scroll finishes. | |
orientation | 'horizontal' | 'vertical' | 'horizontal' | Direction of the track. Vertical sliders fill from the bottom. |
leftIcon | ReactNode | volume low icon | Icon at the start of the track. Pass null to hide it. |
rightIcon | ReactNode | volume high icon | Icon at the end of the track. Pass null to hide it. |
iconPlacement | 'outside' | 'inside' | 'outside' | Puts the icons beside the track, or inside it once the track is thick enough to hold them. |
valuePosition | 'top' | 'bubble' | 'inside' | 'none' | 'top' | Where the value shows. Bubble rides above the fill while the slider is active. |
formatValue | (value: number) => string | Formats the shown value and the value read by screen readers. | |
ticks | boolean | number[] | Marks along the track. True marks every step, or every tenth when not stepped. An array marks those values. | |
thumb | Shows a round handle at the end of the fill. | ||
fillFrom | startingValue | Value the fill grows from. Set it to the middle of the range for a centered, two-way fill. | |
thickness | 6 | Track thickness in px at rest. | |
activeThickness | 12 | Track thickness in px while hovered, focused or dragged. | |
radius | Corner radius of the track in px. Fully round when left out. | ||
restOpacity | 0.7 | Opacity while idle. The slider brightens to full when active. | |
growOnHover | Hovering activates the slider. When off it only grows while pressed or focused. | ||
maxStretch | 50 | Furthest the track stretches in px when pulled past an end. 0 turns the stretch off. | |
bounce | 0.5 | How much the track wobbles as it springs back, from 0 to 0.95. | |
jumpToClick | Pressing the track jumps to the pointer. When off, dragging moves the value from where it was. | ||
wheel | Lets the scroll wheel change the value. | ||
trackColor | 'color-mix(in srgb, currentColor 18%, transparent)' | Color of the empty track. | |
rangeColor | 'currentColor' | Color of the fill. | |
iconColor | 'currentColor' | Color of the outside icons. | |
contentColor | 'currentColor' | Color of icons, values and ticks over the empty track. | |
fillContentColor | 'auto' | Color of icons, values and ticks over the fill. Auto picks light or dark from the fill color. | |
thumbColor | '#ffffff' | Color of the handle. | |
disabled | Turns off interaction and dims the slider. | ||
ariaLabel | 'Slider' | Accessible name of the slider. | |
| Extra class names for the root. | |||
| Inline styles for the root. |
valuenumberControlled value. Pair it with onChange.
defaultValuenumberStarting value when uncontrolled.
50startingValuenumberLowest value of the range.
maxValuenumberHighest value of the range.
100isSteppedbooleanSnaps the value to stepSize increments.
stepSizenumberSize of each step when isStepped is on.
onChange(value: number) => voidCalled as the value changes.
onChangeEnd(value: number) => voidCalled when a drag, key press or scroll finishes.
orientation'horizontal' | 'vertical'Direction of the track. Vertical sliders fill from the bottom.
'horizontal'leftIconReactNodeIcon at the start of the track. Pass null to hide it.
volume low iconrightIconReactNodeIcon at the end of the track. Pass null to hide it.
volume high iconiconPlacement'outside' | 'inside'Puts the icons beside the track, or inside it once the track is thick enough to hold them.
'outside'valuePosition'top' | 'bubble' | 'inside' | 'none'Where the value shows. Bubble rides above the fill while the slider is active.
'top'formatValue(value: number) => stringFormats the shown value and the value read by screen readers.
ticksboolean | number[]Marks along the track. True marks every step, or every tenth when not stepped. An array marks those values.
thumbbooleanShows a round handle at the end of the fill.
fillFromnumberValue the fill grows from. Set it to the middle of the range for a centered, two-way fill.
startingValuethicknessnumberTrack thickness in px at rest.
6activeThicknessnumberTrack thickness in px while hovered, focused or dragged.
12radiusnumberCorner radius of the track in px. Fully round when left out.
restOpacitynumberOpacity while idle. The slider brightens to full when active.
0.7growOnHoverbooleanHovering activates the slider. When off it only grows while pressed or focused.
maxStretchnumberFurthest the track stretches in px when pulled past an end. 0 turns the stretch off.
50bouncenumberHow much the track wobbles as it springs back, from 0 to 0.95.
0.5jumpToClickbooleanPressing the track jumps to the pointer. When off, dragging moves the value from where it was.
wheelbooleanLets the scroll wheel change the value.
trackColorstringColor of the empty track.
'color-mix(in srgb, currentColor 18%, transparent)'rangeColorstringColor of the fill.
'currentColor'iconColorstringColor of the outside icons.
'currentColor'contentColorstringColor of icons, values and ticks over the empty track.
'currentColor'fillContentColorstringColor of icons, values and ticks over the fill. Auto picks light or dark from the fill color.
'auto'thumbColorstringColor of the handle.
'#ffffff'disabledbooleanTurns off interaction and dims the slider.
ariaLabelstringAccessible name of the slider.
'Slider'Extra class names for the root.
Inline styles for the root.
Dependencies
2 required packages
npm install @hugeicons/react @hugeicons/core-free-icons


