Skip to content
PixiKit

Stretch Slider

A range slider whose track thickens when active, stretches like rubber when pulled past an end and wobbles back. Icons, ticks, a handle, a value bubble and a vertical layout are options.

pixikit.com/docs/components/stretch-slider

Customize

Is stepped
Step size10
Orientation
Icon placement
Value position
Ticks
Thumb
Fill from0
Thickness6px
Active thickness12px
Radius40px
Rest opacity0.70
Grow on hover
Max stretch50px
Bounce0.50
Jump to click
Wheel
Range color

Props

36
NameTypeDefaultDescription
valuenumberNoneControlled value. Pair it with onChange.
defaultValuenumber50Starting value when uncontrolled.
startingValuenumber0Lowest value of the range.
maxValuenumber100Highest value of the range.
isSteppedbooleanfalseSnaps the value to stepSize increments.
stepSizenumber1Size of each step when isStepped is on.
onChange(value: number) => voidNoneCalled as the value changes.
onChangeEnd(value: number) => voidNoneCalled when a drag, key press or scroll finishes.
orientation"horizontal" | "vertical""horizontal"Direction of the track. Vertical sliders fill from the bottom.
leftIconReactNodeQUIETIcon at the start of the track. Pass null to hide it.
rightIconReactNodeLOUDIcon 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) => stringNoneFormats the shown value and the value read by screen readers.
ticksboolean | number[]falseMarks along the track. True marks every step, or every tenth when not stepped. An array marks those values.
thumbbooleanfalseShows a round handle at the end of the fill.
fillFromnumberNoneValue the fill grows from. Set it to the middle of the range for a centered, two-way fill.
thicknessnumber6Track thickness in px at rest.
activeThicknessnumber12Track thickness in px while hovered, focused or dragged.
radiusnumberNoneCorner radius of the track in px. Fully round when left out.
restOpacitynumber0.7Opacity while idle. The slider brightens to full when active.
growOnHoverbooleantrueHovering activates the slider. When off it only grows while pressed or focused.
maxStretchnumber50Furthest the track stretches in px when pulled past an end. 0 turns the stretch off.
bouncenumber0.5How much the track wobbles as it springs back, from 0 to 0.95.
jumpToClickbooleantruePressing the track jumps to the pointer. When off, dragging moves the value from where it was.
wheelbooleanfalseLets the scroll wheel change the value.
trackColorstring"color-mix(in srgb, currentColor 18%, transparent)"Color of the empty track.
rangeColorstring"currentColor"Color of the fill.
iconColorstring"currentColor"Color of the outside icons.
contentColorstring"currentColor"Color of icons, values and ticks over the empty track.
fillContentColorstring"auto"Color of icons, values and ticks over the fill. Auto picks light or dark from the fill color.
thumbColorstring"#ffffff"Color of the handle.
disabledbooleanfalseTurns off interaction and dims the slider.
ariaLabelstring"Slider"Accessible name of the slider.
classNamestring""
styleCSSPropertiesNone

More forms components in Pro

View all

Related