Skip to content

Scrub Slider

Free

A slider in one row: the label, the value, and the fill behind them. Press to jump, drag to scrub, or double-click the value to type it.

  • Base UI
  • Motion
  • React 19
  • Tailwind CSS 4

Added Nov 10, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Put the label and the value inside the row. Use ScrubSliderGroup for a panel of rows.

corner-radius.tsx

ScrubSlider

<div>
PropTypeDefaultDescription
classNamestring—
size"default""lg""sm""default"
thumb"bar""caps""fat""line""pill""bar"The look of the thumb: bar (default), line, pill, caps, or fat.
ticksnumber | false—The number of spaces between ticks. Default: one tick per step, and at most 12 spaces: a finer step thins out to a nice interval (1, 2, 2.5, or 5 × 10ⁿ, kept a whole number of steps). false draws no ticks.
controlReactNode—The row, in place of the default: a ScrubSliderControl with a ScrubSliderTrack and your label and value inside. With it, children and thumbProps are not used.
thumbPropsOmit<ScrubSliderThumbProps, "index">—Props for the default thumb: getAriaLabel, getAriaValueText, aria-label.
From Base UISlider.RootBase UI docs
defaultValuenumber—The uncontrolled value of the slider when it's initially rendered. To render a controlled slider, use the value prop instead.
disabledbooleanfalseWhether the slider should ignore user interaction.
formatNumberFormatOptions—Options to format the value.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderControl

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderTrack

<div>
PropTypeDefaultDescription
classNamestring—
thumbPropsOmit<ScrubSliderThumbProps, "index">—Props for the default thumb.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderIndicator

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderTicks

<div>
PropTypeDefaultDescription
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderThumb

<div>
PropTypeDefaultDescription
classNamestring—
From Base UISlider.ThumbBase UI docs
disabledbooleanfalseWhether the thumb should ignore user interaction.
aria-valuetextstring—A string value forwarded to the aria-valuetext attribute of the input. Ignored when getAriaValueText is provided.
getAriaLabel((index: number) => string) | null—A function which returns a string value for the aria-label attribute of the input.
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderLabel

<div>
PropTypeDefaultDescription
classNamestring—
...props<div> attributes—Every other attribute goes to the <div>, with a ref.

ScrubSliderValue

<output>
PropTypeDefaultDescription
classNamestring—
From Base UISlider.ValueBase UI docs
children—
render—Allows you to replace the component's HTML element with a different tag, or compose it with another component. Accepts a ReactElement or a function that returns the element to render.
style—Style applied to the element, or a function that returns a style object based on the component's state.
...props<output> attributes—Every other attribute goes to the <output>, with a ref.

ScrubSliderGroup

<fieldset>
PropTypeDefaultDescription
...props<fieldset> attributes—Every other attribute goes to the <fieldset>, with a ref.
  • Use it in a properties panel, an inspector, or an editor sidebar.
  • Use ScrubSliderGroup to put rows on one muted panel.
  • Use format and locale for units, such as percent, degrees, or milliseconds.
  • Use it when people need both a drag and an exact typed value.
  • For one value in a form with a big track, use a Slider.
  • For an exact number with steppers only, use a Number Field.
  • For a value that should feel physical, such as a volume, use an Elastic Slider.
Arrow keysChanges the value by one step.
Shiftarrow keysorPage UporPage DownChanges the value by largeStep.
HomeorEndGoes to the minimum or the maximum.
EnterOpens the text edit of the value. In the edit, Enter saves.
EscapeIn the text edit: cancels the edit.

The thumb is a native range input: the keys step the value, and a form can read it with name.

The ScrubSliderLabel names the thumb; the text edit has the same name.

The ticks and the visible bar are decoration (aria-hidden).

On touch, a swipe across the row scrolls the page and keeps the value. A swipe along it scrubs.

Jump
glide · a press, a key, or a typed value glides the fill to the new value
Drag
none · a drag follows the pointer at once
Stretch
follow · a drag past an end stretches the row up to 8px and springs back on release
Thumb
hover · the thumb grows in on hover and focus, and grows more while dragging
Text edit
popup · the edit field scales in from 96% while the value fades out
  1. AddedScrub Slider.
Open the release