Skip to content

Props

PropertyTypeDefaultDescription
minnumber0The lowest value in the range.
maxnumber2The greatest value in the range.
stepnumber0.1The step increment between values.
labelstring | ReactNodeLabel text. If a string, it doubles as aria-label. Renders the titlebar when provided.
valuenumberControlled value.
initialValuenumberInitial value on first render.
onChange(value: number) => voidCalled on every value change during interaction.
onStep(value: number) => voidCalled when the value crosses to a different step tick. Useful for sound or haptic feedback.
colorstring'#fff'Base color for ticks and value labels.
activeColorstring'#fff'Color for highlighted (in-range) ticks and the indicator dot.
disabledbooleanfalseDisables all interaction.
showIndicatorbooleanfalseRenders the indicator dot below the slider.
showShadowsbooleanfalseRenders gradient edge shadows.
mouseSensitivitynumber1.5Controls how fast the slider moves when dragging with a mouse.
touchSensitivitynumber1.5Controls how fast the slider moves when dragging on touch devices.
fractionClassNamestringClass name applied to each fraction tick element.
classNamestringClass name for the root container.
childrenReactNodeCustom layout using compound components. Overrides all automatic UI.

All standard HTML div attributes are also supported and forwarded to the root element.

Use initialValue for uncontrolled mode (the component manages its own state):

<FractionalRange initialValue={1.5} min={0} max={3} step={0.1} />

Use value for controlled mode (you manage the state):

const [val, setVal] = useState(1.5)
<FractionalRange value={val} onChange={setVal} min={0} max={3} step={0.1} />

The slider element has role="slider" with proper aria-valuemin, aria-valuemax, and aria-valuenow attributes. When label is a string, it’s automatically used as aria-label. For non-string labels, pass aria-label explicitly:

<FractionalRange
label={<CustomLabel />}
aria-label="Volume control"
min={0}
max={100}
step={1}
/>