ComponentsSlider

Slider

A customizable slider component for selecting values within a range



50
50

The Slider component creates a customizable slider input that can be used for single value or range selection. It is a great way to allow users to select values within a specified range.

Tip!

Use the range prop to create a range slider with two thumbs.

Warning!

The Slider component uses the 'use client' directive, ensuring it's only rendered on the client-side. Be mindful of this when using it in your Next.js application.




Props

PropTypeDefaultDescription
minnumber0The minimum value of the slider.
maxnumber100The maximum value of the slider.
stepnumber1The step value of the slider.
valuenumber0The value of the slider.
defaultValuenumber0The default value of the slider.
showValuebooleanfalseWhether to show the value of the slider.
showLabelsbooleantrueWhether to show the labels of the slider.
valuePositionstring'left'The position of the value. Possible values: 'left', 'right'.
trackColorstring'primary-500'The color of the track.
thumbColorstring'primary-500'The color of the thumb.

Info

The component also accepts any additional props that can be applied to the ReactSlider component.




Usage Examples

Basic Slider

50

Custom Slider

50
0
100

Tip!

Experiment with different props and styles to create sliders that fit your design needs and use cases.