# Elastic Slider

> A slider that stretches like rubber past its ends and springs back.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Inputs |
| Live preview | https://uibrik.com/components/elastic-slider |
| Writes | 1 file into `components/uibrik/elastic-slider/` |
| Packages | `@number-flow/react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 9, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/elastic-slider.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/elastic-slider`.

Can't run commands? https://uibrik.com/components/elastic-slider/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { ElasticSlider } from "@/components/uibrik/elastic-slider/elastic-slider";

<ElasticSlider
  label="Elastic Slider"
  defaultValue={40}
  min={0}
  max={100}
  width={320}
  onChange={(value) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/elastic-slider.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `label` | `string` | `"Elastic Slider"` |  |
| `defaultValue` | `number` | `40` | Starting value. |
| `min` | `number` | `0` | Lowest value. |
| `max` | `number` | `100` | Highest value. |
| `width` | `number` | `320` | Track width. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `onChange` | `(value: number) => void` |  | Called as the value changes. |

## Where it fits

- **Volume and brightness**: A slider that stretches past its ends and springs back makes limits feel physical.
- **Consumer settings**: A rubbery feel suits playful apps where a plain range input looks out of place.
- **Media controls**: The stretch gives clear feedback when a value is already at its minimum or maximum. Pairs with [Music Player](https://uibrik.com/components/music-player.md) (Pro).

## Same shelf: Inputs

- [Field Slider](https://uibrik.com/components/field-slider.md) (Pro): A slider drawn as a row of fine ticks with no track, the filled side in a soft gradient: the handle acts like a magnet, so nearby ticks lean toward it like iron filings and a drag sends a soft wave through the row.
- [Filter Bar](https://uibrik.com/components/filter-bar.md) (Pro): A filter bar whose pills read as sentences: the Filter button grows into a menu, the menu shrinks into the new pill, operators flip in place and the result count rolls to each new total.
- [Gamut Picker](https://uibrik.com/components/gamut-picker.md) (Pro): An OKLCH colour picker on a three.js model of the sRGB gamut: the solid is cut at the current lightness, you pick hue and chroma on the cut face, and colours past the gamut edge are held to it with a ghost showing where you asked.
- [Inline Edit](https://uibrik.com/components/inline-edit.md): A label that opens into an input in place, with save and cancel sliding out from its edge, then folds back to the new value.
- [Multi-step Form](https://uibrik.com/components/multi-step-form.md) (Pro): A pill that opens into a four-step form, then folds back into a summary.
- [OTP Input](https://uibrik.com/components/otp-input.md) (Pro): One-time code field whose boxes merge and scramble into a pass or fail result.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/elastic-slider/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
