Fluid Slider

Use Fluid Slider for a numeric value that benefits from direct adjustment. People can drag the indicator or select a position on the track, while the label and current value stay visible.

Preview

Reduce motion:Off
Tune:Off
Inspect
Frequency

Installation

Basic usage

TypeScript
volume-slider.tsx

Examples

Use value and onValueChange for controlled state. Reference marks and formatted values help when the scale has meaningful thresholds.

Usage

API

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.
editableValuebooleantrueWhether the visible value can be edited as an exact number.
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.

Accessibility

Fluid Slider uses Base UI range semantics, keyboard controls, and form integration. The semantic value stays within its constraints even when the visual edge response adds resistance.

Styling

The fluid-slider token set lets you adapt surfaces, labels, and the boundary indicator to your theme. Reduced-motion and keyboard updates remain immediate.

Contact

Found a bug or need help using this component? Open an issue on GitHub.

License & Usage

Sona UI is available under the MIT license. You may use, modify, and distribute this component in personal and commercial projects.

Was this page helpful?

Your response helps us improve component docs.

Related components