Skip to content

shadcn.io is an independent project built on shadcn/ui

Free

Height Selector Slider for Svelte

A vertical Height slider from 100 to 250 cm, starting at 170 cm, with the reading under the track.

UI library: Ark UI

Height (cm) sits above a vertical track, and 170 cm sits under it. The scale runs from 100 to 250.

Use it for a measurement people picture from top to bottom. A Number Input is better when they already know the height. In Svelte, Ark UI moves this thumb with the up and down keys.

Preview

Preview width

Installation

MCP · Pro
Make your AI a shadcn expert
Your agent installs components, builds pages and restyles your app from one prompt, in Claude Code, Cursor or VS Code.
Part of Pro

Anatomy

Slider anatomy: root, label, value, track, range, thumb

Usage

<div class="flex flex-col items-center gap-4"><Label>Height (cm)</Label><div class="h-64"><Slider aria-label={["Height"]} max={250} min={100} onValueChange={handleValueChange} orientation="vertical" value={value} /></div><span class="text-muted-foreground text-sm tabular-nums">{value[0]} cm</span></div>

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 details.value, the new 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 Ark UI, aria-label is a list with one name per thumb.

How do I show feet and inches?

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

API Reference

Label

No extra props in this demo. The rest is on the Label page.

Slider

Sets aria-label={["Height"]}, max={250}, min={100}, onValueChange={handleValueChange}, orientation="vertical" and value={value}. The rest is on the Slider page.