Skip to main content

Installation

Usage

Component API

Slider

Range slider component built on Radix UI Slider.
Props:
  • defaultValue - Default value(s) as array (e.g., [50])
  • value - Controlled value(s) as array
  • onValueChange - Callback when value changes
  • min - Minimum value (default: 0)
  • max - Maximum value (default: 100)
  • step - Step increment (default: 1)
  • disabled - Disables the slider
  • orientation - Layout direction ("horizontal" | "vertical")

Implementation

The slider automatically creates thumbs based on the number of values:

Examples

Basic Slider

Single value slider:

Range Slider

Two thumbs for a range:

Multiple Thumbs

Multiple values:

With Label

Slider with value display:

Vertical Slider

Vertical orientation:

Controlled Slider

Disabled Slider

Custom Step

Larger increments:

Temperature Control

Practical example:

Volume Control

Price Range

Filter by price range:

Accessibility

  • Full keyboard support (arrow keys, Home, End, Page Up/Down)
  • Proper ARIA attributes
  • Focus visible states
  • Screen reader announcements
  • Touch-friendly thumb size

API Reference

See the Radix UI Slider documentation for complete API reference.