# Slider with dynamic tooltip indicator

> Slider with dynamic tooltip indicator

A shadcn/ui block from the [@reui](https://reui.io) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/reui/c-slider-11).

- Page, with a live preview: https://shadcn.exchange/r/reui/c-slider-11
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/reui/c-slider-11-light-258238f437c772ef.png
- Registry item: https://reui.io/r/new-york-v4/c-slider-11.json
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://reui.io/r/new-york-v4/c-slider-11.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Dependencies

- Registry items: `label`, `slider`

## Files

### `c-slider-11.tsx`

```tsx
"use client"

import { useState } from "react"

import { Label } from "@/components/ui/label"
import { Slider } from "@/components/ui/slider"

export function Pattern() {
  const [value, setValue] = useState(50)
  const min = 0
  const max = 100
  const percentage = ((value - min) / (max - min)) * 100

  return (
    <div className="mx-auto grid w-full max-w-sm gap-4">
      <Label className="text-sm font-medium">Volume</Label>
      <div className="relative pt-7">
        <div
          className="bg-foreground text-background absolute top-0 rounded px-2 py-0.5 text-xs font-semibold tabular-nums"
          style={{
            left: `${percentage}%`,
            transform: "translateX(-50%)",
          }}
        >
          {value}%
          <div className="bg-foreground absolute -bottom-1 left-1/2 size-2 -translate-x-1/2 rotate-45" />
        </div>
        <Slider
          value={[value]}
          onValueChange={(val) =>
            setValue(Array.isArray(val) ? (val[0] ?? 50) : val)
          }
          min={min}
          max={max}
          step={1}
        />
      </div>
    </div>
  )
}
```
