Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Slider examples · Vertical

Height Selector Slider for React

A vertical Height slider from 100 to 250 cm with the reading under it.

Framework
UI library

Height reads naturally top to bottom. The vertical slider runs from 100 to 250 cm, with the label above and the reading below. Use it for body measurements or any vertical quantity.

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 it made vertical?

orientation="vertical", inside a h-64 box. The slider fills that box, so the box sets its length.

How does the readout follow the thumb?

The value lives in state, starting at 170, and goes back to the slider as value. The reading under it prints it with cm. onValueChange receives the new value, and the handler stores it as an array.

What range does it cover?

100 to 250 in steps of 1. min and max set the ends.

Which keys move it?

Up and Right raise the value, Down and Left lower it, and Home and End jump to 100 and 250.

How is it named?

Height (cm) is a visible Label, and the slider has aria-label Height. On Base UI, aria-label is one string on the slider.

How do I show feet and inches?

Convert the value before you print it. The slider stays in centimeters.