Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Slider examples · Vertical

Vertical with Labels Slider for React

A vertical Level slider with a 0 to 100 scale beside the track and the reading on the other side.

Framework
UI library

A scale beside the track, like a ruler. 100 to 0 run down one side, and the label and value sit on the other. Use it for mixers or meters.

Preview

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

FAQ

How is the scale placed?

A marks array mapped into a h-48 column with justify-between, the same height as the slider, so 100 is at the top and 0 at the bottom.

How does the readout follow the thumb?

The value lives in state, starting at 50, and goes back to the slider as value. The number under the Level label prints it. onValueChange receives the new value, and the handler stores it as an array.

How is it made vertical?

orientation="vertical", inside a h-48 box.

How is the slider named?

The Level text is a visible Label, and the slider gets the same name with aria-label, so screen readers announce what it sets. On Base UI, aria-label is one string on the slider.

What range does it cover?

0 to 100. The scale is plain text, so change both together. min and max set the ends.

Can I move it from the keyboard?

Yes. The thumb takes focus with Tab. The arrow keys move it by one step, Page Up and Page Down by a larger step, and Home and End jump to the ends.