Redpanda UIRedpanda UI

Slider

An input where the user selects a value from within a given range.

Made by shadcn

Installation

Loading component...

Range

Loading component...

Vertical orientation

Loading component...

Disabled

Loading component...

Live value label

Loading component...

Custom step increments

Loading component...

Formatted value

Loading component...

Drag bubble

Loading component...

Custom min, max, and step

Loading component...

When to use

Sliders allow users to select a value from a range. Use this decision tree:

Usage

import { Slider } from "@/components/ui/slider"
<Slider defaultValue={[33]} max={100} step={1} />

Props

Keyboard interactions

KeyAction
Tab to thumbFocus lands on the thumb. Range sliders have one thumb per value.
ArrowLeft / ArrowDownDecreases value by one step.
ArrowRight / ArrowUpIncreases value by one step.
PageDown / PageUpDecreases / increases by a larger step (roughly 10% of the range).
Home / EndJumps to min / max.

Accessibility

  • Each thumb exposes role="slider" with aria-valuemin, aria-valuemax, and aria-valuenow. Always provide a programmatic label (<Label> + aria-labelledby, or aria-label) describing what the value represents.
  • Pair the slider with a visible numeric value where precision matters — sliders alone are hard to read for screen-reader and low-vision users.
  • onValueChange receives number[] (always an array, even for single-thumb sliders) — unwrap with value[0] when you only need a scalar.
  • Range sliders enforce minValue[i] <= value[i] <= value[i+1] <= maxValue automatically; you don't need to clamp in user land.

Credits

  • We use Base UI for the slider component.
  • We take our inspiration from Shadcn UI for the slider style.

Recent changes

  • patchv1.2.0Pin shipped dependency floors to the version we develop against. Registry items now declare ranges like `^5.1.9` (the actual installed version) instead of collapsing to `^5.0.0`, so consumers start on the known-tested b…#133
  • minorv1.1.0Theme docs refresh, readability pass on semantic foregrounds, and consumer-facing Base UI regression fixes.#121
  • minorv1.0.0Post-Base-UI polish. Public API unchanged.#116
  • majorv1.0.0Migrate every Radix-based primitive to `@base-ui/react@^1.4.0` (Base UI).#114
  • minorv0.3.0Add theme-provider component to the registry with documentation and tests. Includes playground type improvements (export RegistryItem, remove as-const boilerplate) and docs site dark mode border color fix.#109
See full history →
Built by malinskibeniamin. The source code is available on GitHub.

On this page