Skip to content

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

Free

Simple Slider for Ark UI

A bare slider with one thumb and no label or number, starting at 50 on a track from 0 to 100.

One track and one thumb, and nothing else. It starts at 50, with no label and no readout on the page.

Use it in a row that already names the setting. Add a Label when the slider stands on its own. In React, Ark UI keeps this value inside the slider.

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.
Use email insteadNo credit card

Anatomy

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

Usage

<div className="w-full max-w-md">
  <Slider aria-label={["Value"]} defaultValue={[50]} />
</div>

FAQ

Where does the value live?

Inside the slider. It starts at 50 from defaultValue, and nothing outside reads it. Make it controlled when something else needs the number.

What range does it cover?

0 to 100 in steps of 1, the defaults. min and max set the ends.

How is it named without a label?

With aria-label set to Value, so screen readers still announce something. Use a word that says what it sets, such as Volume. On Ark UI, aria-label is a list with one name per thumb.

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.

How wide is it?

It fills a w-full max-w-md wrapper. The track stretches to the wrapper's width.

Does it submit with a form?

Give it a name and its value goes with the form. It renders a hidden input per thumb.

API Reference

Slider

Sets aria-label={["Value"]} and defaultValue={[50]}. The rest is on the Slider page.