Fluid Slider Component

A labeled Base UI range control with a dedicated draggable indicator and a surface that moves directly to any selected value.

Features

  • Drag the boundary indicator for precise, continuous adjustment.
  • Click anywhere on the surface to move directly forward or backward to that value.
  • Fixed label and trailing value keep the control readable throughout adjustment.
  • Base UI range semantics, keyboard controls, form integration, and value constraints.
  • Restrained rubber-band feedback at the minimum and maximum without changing the semantic value.
  • Optional reference marks, formatted values, and boundary handle.
  • Instant keyboard and reduced-motion updates with no decorative bounce.
  • Semantic --fluid-slider-* tokens for consumer theme customization.
Frequency
15%
Resonance
6

Playground

Change the initial value and label, then compare direct surface selection with precise indicator dragging.

Frequency
35%
Controls
Controls

Installation

Usage

Props

PropertyTypeDefaultDescription
labelReactNoderequiredVisible label associated with the slider.
valuenumberundefinedControlled slider value.
defaultValuenumber50Initial value for uncontrolled usage.
onValueChange( value: number, details: Slider.Root.ChangeEventDetails, ) => voidundefinedCalled continuously while the value changes.
onValueCommitted( value: number, details: Slider.Root.CommitEventDetails, ) => voidundefinedCalled when a pointer or keyboard interaction commits.
minnumber0Minimum allowed value.
maxnumber100Maximum allowed value.
stepnumber1Smallest value increment.
largeStepnumber10Increment used by Page Up, Page Down, and modified arrow keys.
marksnumber[][]Numeric positions rendered as quiet reference marks.
formatValue(value: number) => stringundefinedFormats the visible and accessible value text.
formatIntl.NumberFormatOptionsundefinedIntl options used when no custom formatter is supplied.
localeIntl.LocalesArgumentundefinedLocale used by the default number formatter.
showValuebooleantrueWhether the trailing formatted value is visible.
showHandlebooleantrueWhether the active boundary grip is visible.
disabledbooleanfalseWhether the slider ignores user interaction.
namestringundefinedName submitted with the slider's hidden range input.
formstringundefinedID of the form that owns the slider input.
ariaLabelstringundefinedAccessible name used instead of the visible label.
classNamestringundefinedAdditional classes for the slider root.
trackClassNamestringundefinedAdditional classes for the track surface.
surfaceClassNamestringundefinedAdditional classes for the filled surface.
labelClassNamestringundefinedAdditional classes for the fixed label.
valueClassNamestringundefinedAdditional classes for the trailing value.
handleClassNamestringundefinedAdditional classes for the boundary grip.