Browse docsSlider

Controls

Glass Slider

A glass slider for one value or a range, with one named thumb per value.

Preview

Demos ready. Update 0.

Installation

For React 19+ apps with Tailwind CSS 4.

npx shadcn@4.14.1 add @glassyui/glass-slider

Adds 7 files to components/glassyui and installs @radix-ui/react-slider and clsx.

Usage

Usage

import { GlassSlider } from "@/components/glassyui/glass-slider";

export function SliderDemo() {
  return <GlassSlider aria-label="Volume" defaultValue={[60]} max={100} step={1} />;
}

Examples

Range

<GlassSlider
  aria-label="Price"
  defaultValue={[20, 80]}
  thumbLabels={["Minimum price", "Maximum price"]}
/>

API reference

GlassSlider

Renders the track, the filled range and one thumb per value.

PropTypeDefaultDescription
value / defaultValuenumber[][min]Controlled or uncontrolled values; the array length sets the number of thumbs.
onValueChange(value: number[]) => voidNoneCalled on every change while dragging or stepping.
onValueCommit(value: number[]) => voidNoneCalled when a drag ends or a key changes the value.
min / max / stepnumber0 / 100 / 1Range and increment of the values.
aria-labelstringNoneMoved to the thumbs: a single thumb takes it as is; range thumbs get it with ', minimum', ', maximum' or ', 2 of 3' added.
thumbLabelsstring[]NoneNames each thumb in value order, replacing the names built from aria-label.

Also accepts Radix Slider.Root props.

Types
GlassSliderProps
Accessibility
Each thumb is its own slider; name range sliders with aria-label or thumbLabels, because aria-labelledby is copied to every thumb and gives them all the same name.