JellySlider

Thumb trails the pointer, squashes with speed, stretches like rubber past the ends and lifts a leaning value bubble. Inputs.

Open playground
62

About

JellySlider is a React component in the Inputs category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { JellySlider } from "@ashutoshswamy/smoui" and set value, min, onChange among its 4 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { JellySlider } from "@ashutoshswamy/smoui";

<JellySlider label="Volume" defaultValue={62} onChange={(n) => setVolume(n)} />

Props 4

value / defaultValue

Controlled or initial value.

numberdefault 40
min / max / step

Range.

numberdefault 0 / 100 / 1
onChange

Called as the value changes.

(value: number) => void
label

Accessible name. Arrow keys, Home and End work.

string