Slider

A Slider component is a UI element that allows users to select a value from a range by sliding a handle along a track. It provides an interactive way to adjust settings, such as volume, brightness, or other continuous values, with smooth transitions. Sliders can be single or multi-valued, enabling users to make precise selections visually, enhancing the overall user experience.
# Demo

Basic Slider Examples

Simple slider components with different configurations.

Single Value Slider

Current value: 50

Range Slider

Range: 25 - 75

Step Slider

Current value: 5

Themed Sliders

Sliders with icons and contextual styling.

Volume Control

Mute70%Max

Brightness

Dark80%Bright

Temperature

16°C22°C30°C

Quality Rating

Poor
8
Excellent

Audio Settings Panel

Multiple sliders for audio configuration.

Audio Configuration

75%
50%
60%
C
LeftCenterRight

Display Settings Panel

Visual settings with real-time preview.

Display Configuration

80%
70%
65%
50°
Preview

Disabled Slider

Slider in disabled state.

This slider is disabled and cannot be interacted with.

Vertical Sliders

Sliders with vertical orientation.

Equalizer

601kHz
803kHz
455kHz
907kHz
709kHz
5511kHz
8513kHz

Slider Best Practices

Guidelines for effective slider implementation.

✅ Do

  • • Provide clear labels and value indicators
  • • Use appropriate min/max ranges
  • • Choose sensible step values
  • • Show current values prominently
  • • Use icons for context when helpful
  • • Provide immediate visual feedback
  • • Consider keyboard navigation

❌ Don't

  • • Use sliders for precise value entry
  • • Make sliders too small to interact with
  • • Use unclear or missing labels
  • • Set inappropriate step sizes
  • • Forget to show current values
  • • Use sliders for binary choices
  • • Ignore accessibility requirements

Slider Values Summary

Current values and interaction history.

Current Values

Basic Slider:50
Range:25 - 75
Volume:70%
Brightness:80%
Temperature:22°C
Quality:8/10

Recent Changes

No changes yet. Try adjusting some sliders above.

Total interactions: 0
# Usage
# Attributes
NameTypeDefaultDetails
labelReact.ReactNodeOptionalLabel for the slider.
classNamestring' 'You can customise by passing tailwind classes.
labelClassNamestring' 'You can customise by passing tailwind classes.
sliderClassNamestring' 'You can customise by passing tailwind classes.
idstringOptionalID for the slider.
valuenumberOptionalCurrent slider value.
defaultValuenumberOptionalDefault slider value.
minnumberOptionalMinimum slider value.
maxnumberOptionalMaximum slider value.
stepnumberOptionalStep increment for slider.
disabledbooleanfalseWhether the slider is disabled.
orientation'horizontal' | 'vertical'OptionalOrientation of the slider.
onChange(value: number) => voidOptionalCallback when value changes.
aria-labelstringOptionalARIA label for accessibility.
aria-labelledbystringOptionalARIA labelledby for accessibility.
aria-valuetextstringOptionalARIA value text for accessibility.