---
title: "Bubble Slider"
description: "Free React slider: grab the thumb and a value bubble pops out, tilting and squashing with drag speed before it settles. Keyboard accessible, shadcn install."
category: "Components"
parent: "https://beui.dev/components/motion/range-slider"
publishedAt: "2026-06-24"
updatedAt: "2026-11-25"
documentation: "https://beui.dev/components/motion/range-slider/bubble"
markdown: "https://beui.dev/components/motion/range-slider/bubble.md"
license: "MIT"
---

# Bubble Slider

> Free React slider: grab the thumb and a value bubble pops out, tilting and squashing with drag speed before it settles. Keyboard accessible, shadcn install.

## Install

```bash
npx shadcn@latest add @beui/range-slider-bubble
```

## Dependencies

- `clsx`
- `motion`
- `react`
- `tailwind-merge`

## Usage

### Bubble Slider usage

Grab the thumb and a value bubble pops out of it. The bubble tilts and squashes with how fast you drag, then settles upright.

```tsx
"use client";

import { useState } from "react";

import { BubbleSlider } from "@/components/motion/range-slider-bubble";

export function RangeSliderBubblePreview() {
  const [value, setValue] = useState(28);

  return (
    <div className="flex w-full max-w-sm flex-col gap-1">
      <span className="text-sm text-muted-foreground">Drag fast and the bubble leans</span>
      <BubbleSlider sound value={value} onValueChange={setValue} aria-label="Value" />
    </div>
  );
}
```

## API Reference

### BubbleSlider

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `format` | `((value: number) => string)` | — | No | Formats the value shown in the bubble. |
| `className` | `string` | — | No | Classes merged onto the root element. |
| `value` | `number` | — | No | The current value, for controlled use. |
| `defaultValue` | `number` | — | No | The initial value when uncontrolled. Default: 0 |
| `onValueChange` | `((value: number) => void)` | — | No | Called with the snapped value whenever a drag or key press changes it. |
| `min` | `number` | — | No | Lowest value on the track. Default: 0 |
| `max` | `number` | — | No | Highest value on the track. Default: 100 |
| `step` | `number` | — | No | Increment values snap to when dragging or using arrow keys. Default: 1 |
| `disabled` | `boolean` | — | No | Ignores pointer and keyboard input. Default: false |
| `aria-label` | `string` | — | No | Accessible name for the slider handle. |
| `formatValueText` | `((value: number) => string)` | — | No | Announced instead of the raw number — pass one when the value carries a unit or a suffix ("72.5 kg", "35%"); a bare number needs no valueText. |
| `sound` | `boolean` | — | No | Play a tiny tick per step, higher toward the max. Off by default; a `SoundProvider` can mute it app-wide. |

## More in Range Slider

- [Inline Slider](https://beui.dev/components/motion/range-slider/inline.md)
- [Range Slider](https://beui.dev/components/motion/range-slider/stepped.md)
- [Fluid Slider](https://beui.dev/components/motion/range-slider/fluid.md)
- [Wave Slider](https://beui.dev/components/motion/range-slider/wave.md)
- [Ruler Slider](https://beui.dev/components/motion/range-slider/ruler.md)

## Source

- Registry detail: https://beui.dev/r/range-slider-bubble
- Raw source: https://beui.dev/r/range-slider-bubble/raw
- GitHub: https://github.com/starc007/ui-components
