Skip to content

Elastic Slider

Free

A slider whose track stretches past its ends and springs back when you let go. It has a value tag that sways, marks that hold the thumb, and end icons.

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

Added Nov 10, 2026 · MIT + Commons Clause

Playground

Loading the preview

Props

Children go above the track. Add the end icons as parts, and tooltip for the value tag.

volume-slider.tsx

ElasticSlider

<div>
PropTypeDefaultDescription
classNamestring—
controlReactNode—The control under the children. Default: a SliderControl with the track, the indicator, and one thumb per value. Pass your own SliderControl to change a part (a thumb with a Tooltip).
thumbPropsOmit<SliderThumbProps, "index">—Props for every default thumb: getAriaLabel, getAriaValueText, aria-label, disabled.
tone"destructive""info""neutral""success""warning"—default: the primary fill. A status colors the fill and the thumb edge: success a good value, warning a value that needs care, info a neutral mark, destructive a value over a limit. Color is never the only signal: say it in words too.
glowboolean—A soft halo in the fill color (glow, @gelatin-ui/glow). Default: false.
elasticbooleantrueThe rubber track: a press swells the active thumb and thickens the track, a drag past an end stretches the track with resistance, and the release springs back with one wobble. Home or End at a limit bumps the track. Default true.
tooltip"always" | booleanfalseA value tag over each thumb (ElasticSliderThumbTooltip). true: it shows on hover, on keyboard focus, and while dragging, and sways with the drag speed. "always": it always shows. A SliderValue fades out while a tag shows, so one value is on screen. Default false.
marks—Marks on the track: values, or { value, label } with a label under the track. A drag holds on a mark for 6px (a detent) and a ring pops from the thumb; a press on a label sets its value. Keys and track presses step past marks. Made for thumbAlignment="center" (the default).
From Base UISlider.RootBase UI docs
defaultValueValue—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.

ElasticSliderStartIcon

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

ElasticSliderEndIcon

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

ElasticSliderControl

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

ElasticSliderTrack

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

ElasticSliderThumb

<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.

ElasticSliderMarks

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

ElasticSliderMarkLabels

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

ElasticSliderThumbTooltip

<span>
PropTypeDefaultDescription
classNamestring—
indexRequirednumber—The thumb whose value the tag shows.
...props<span> attributes—Every other attribute goes to the <span>, with a ref.
  • Use it for a volume, a brightness, or a level where a playful feel fits the app.
  • Use tooltip to show the value over the thumb while people drag or use the keys.
  • Use marks with labels for named steps, such as text sizes or speeds.
  • Use ElasticSliderStartIcon and ElasticSliderEndIcon for icons at the ends, such as quiet and loud.
  • For a plain form value with no motion, use a Slider.
  • For an angle or a zoom on a moving scale, use a Ruler Slider.
  • For a number in a dense settings panel, use a Scrub Slider.
Arrow keysChanges the value by one step.
Shiftarrow keysorPage UporPage DownChanges the value by largeStep.
HomeorEndGoes to the minimum or the maximum. At a limit, the track bumps.

Each thumb is a native range input, so the keys step the value and a form can read it.

The value tag, the mark dots, the mark labels, and the end icons are aria-hidden: the thumb says the value.

A press on an end icon or the gap next to the track does nothing.

Press
statusPop · a press on the track swells the thumb and thickens the track
Stretch
elastic · a drag past an end stretches the track up to 24px, then it springs back with one wobble
Bump
elastic · Home, End, or an arrow at a limit bumps the track about 8px
Value tag
sway · the tag tilts with the drag speed, up to 12°, and swings back once
Tag in and out
statusPop · the tag pops in from 60%, and goes out on fadeExit
Mark
indicator · a ring pops from the thumb when a drag reaches a mark

Built with

Installs with Elastic Slider

Components
Slider
  1. AddedElastic Slider, with Slider.
Open the release