Drag & physics

Elastic slider

Pull past either end and the track stretches like rubber, then wobbles back into shape.

Paste it into ChatGPT, Claude, Cursor or v0.
step1

Usage

React
import { ElasticSlider } from '@vizzele/react';

const [volume, setVolume] = useState(40);

<ElasticSlider
  label="Volume"
  value={volume}
  onChange={setVolume}
  startIcon={<SpeakerLow />}
  endIcon={<SpeakerHigh />}
/>

Props

PropTypeDefaultDescription
labelstring—Accessible name (required).
value / defaultValuenumber50Controlled or uncontrolled value.
min / max / stepnumber0 / 100 / 1Range.
onChange(v: number) => void—Value changes.
formatValue(v: number) => string—Display + aria-valuetext.
startIcon / endIconReactNode—Icons that get pushed by the stretch.
showValuebooleantrueShow the value.

Accessibility

  • role="slider" with aria-valuemin/max/now/text on the thumb.
  • Arrows, PageUp/PageDown, Home/End. Bumping an end with the keyboard wobbles the track.