# Slider: Value bubble

> `showValue` shows the formatted value above the thumb while it is dragged or focused from the keyboard. Use it instead of a label row, since the bubble rises into the space above the track.

Example: https://hextaui.com/docs/slider/examples/value-bubble
Component docs: https://hextaui.com/docs/slider.md

## Add this example

```bash
npx shadcn@latest add https://hextaui.com/r/slider-value-bubble.json
```

This adds `components/examples/slider/value-bubble.tsx` with the Slider component and the HextaUI theme tokens.

## Source

```tsx title="components/examples/slider/value-bubble.tsx"
import { Slider } from "@/components/ui/slider"

export function SliderValueBubble() {
  return (
    <div className="flex w-full max-w-xs flex-col gap-10 pt-8">
      <Slider
        defaultValue={0.4}
        max={1}
        step={0.01}
        format={{ style: "percent" }}
        showValue
        aria-label="Opacity"
      />
      <Slider defaultValue={[30, 70]} showValue aria-label="Range" />
    </div>
  )
}
```

## Props in this example

### Slider

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `defaultValue` | `number \| number[]` | – |  |
| `max` | `number` | `100` |  |
| `step` | `number` | `1` |  |
| `showValue` | `boolean` | `false` | Shows the value above the thumb while dragging or keyboard-focused. |
| `format` | `Intl.NumberFormatOptions` | – |  |
| `aria-label` | `string` | – | Names the thumbs. |

## More Slider examples

- [Sizes](https://hextaui.com/docs/slider/examples/sizes.md)
- [Range](https://hextaui.com/docs/slider/examples/range.md)
- [Steps and format](https://hextaui.com/docs/slider/examples/steps.md)
- [Controlled](https://hextaui.com/docs/slider/examples/controlled.md)
- [Vertical](https://hextaui.com/docs/slider/examples/vertical.md)
- [With icons](https://hextaui.com/docs/slider/examples/icons.md)
- [Disabled](https://hextaui.com/docs/slider/examples/disabled.md)
- [Long labels](https://hextaui.com/docs/slider/examples/long-label.md)
- [Right to left](https://hextaui.com/docs/slider/examples/rtl.md)
