ui

Slider

An input where the user selects a value from within a given range. Built with Base UI and Tailwind CSS. Copy-paste ready.

API Reference

Installation

Usage

API Reference

Slider

Root component. Styled wrapper for Slider.Root from Base UI with default min/max values and edge-aligned thumbs.

Note: The component sets thumbAlignment="edge" by default, which aligns thumbs to the edge of the track rather than centering them.

SliderValue

Displays the current value. Styled wrapper for Slider.Value from Base UI.

Examples

For accessible labelling and validation, prefer using the Field component to wrap checkboxes. See the related example: Slider field.

With Label and Value

Pairs a visible label with a SliderValue that updates live as the thumb is dragged.

Disabled

Renders the slider at reduced opacity with interaction blocked — the current value is still visible.

With Reference Labels

Displays min, max, and optional midpoint labels below the track to give users positional context without reading the exact value.

With Tick Marks

Renders discrete tick marks along the track that correspond to valid step positions, guiding snapping behavior.

Tooltip Indicator

A tooltip appears above the thumb as the user drags, displaying the exact current value and dismissing when the thumb is released.

Rating With Emoji

A 1–5 rating slider where the emoji and label below change to reflect the selected sentiment as the thumb moves.

Volume Control

A media-player-style volume slider with a muted/low/high icon that updates as the level changes. Clicking the icon toggles mute on and off.

Price Range

A dual-thumb slider that lets users set a minimum and maximum price. The selected range is shown above the track and updates live as either thumb is dragged.

Hue Color Picker

A full-spectrum hue slider with a gradient track. A color swatch previews the selected hsl() value and updates in real time as the thumb moves.

Temperature Control

A room-temperature slider that colors the label green, blue, or orange to reflect the comfort level, with a text hint that updates as the value changes.

Display Settings

Three sliders — brightness, contrast, and saturation — each displaying a live SliderValue. A Reset button restores all three to their defaults.