HextaUI

Slider: Vertical

With orientation="vertical" the slider fills its parent's height, and Up raises the value.

60 Hz
250 Hz
1 kHz
4 kHz
16 kHz
import { Slider } from "@/components/ui/slider"

const bands = [
  { label: "60 Hz", value: 70 },
  { label: "250 Hz", value: 45 },
  { label: "1 kHz", value: 55 },
  { label: "4 kHz", value: 80 },
  { label: "16 kHz", value: 35 },
]

export function SliderVertical() {
  return (
    <div className="flex h-48 gap-6">
      {bands.map((band) => (
        <div key={band.label} className="flex flex-col items-center gap-3">
          <Slider
            orientation="vertical"
            defaultValue={band.value}
            aria-label={band.label}
          />
          <span className="text-xs text-muted-foreground tabular-nums">
            {band.label}
          </span>
        </div>
      ))}
    </div>
  )
}

This adds the example as components/examples/slider/vertical.tsx, together with the Slider component and the HextaUI theme tokens it needs.

pnpm dlx shadcn@latest add https://hextaui.com/r/slider-vertical.json

To add only the component, follow the Slider installation.

Props in this example

The Slider props this example sets, from the API reference.

PropTypeDefault
defaultValue
number | number[]–
orientation
"horizontal" | "vertical""horizontal"
aria-labelNames the thumbs.
string–

Every prop is in the Slider API reference.

See them all, with keyboard support and accessibility notes, on the Slider page.