🚀ReacUI is currently in Beta. We're actively improving it! ❣️
Slider
A slider component for selecting values within a range
Installation
The Slider component is part of the ReacUI library. Install the package to use it in your project.
Import
Import the Slider component into your React component.
Basic Usage
The Slider component allows users to select a value within a specified range.
Colors
Sliders can be styled with different colors to match your application's theme.
Primary (Default)
Success
Danger
Custom
With Label
Add labels and value indicators to provide more context and improve usability.
75%
0%100%
50%
0%100%
With Markers
Add markers to provide predefined values for the slider.
0
25
50
75
100
API Reference
The following props are available for the Slider component.
| Prop | Type | Default | Description |
|---|---|---|---|
| value | number | 0 | The current value of the slider |
| min | number | 0 | The minimum value of the slider |
| max | number | 100 | The maximum value of the slider |
| step | number | 1 | The step increment value |
| disabled | boolean | false | Whether the slider is disabled |
| color | string | 'primary' | The color of the slider: 'primary', 'success', 'danger', or custom |
| showLimits | boolean | false | Whether to show min and max labels |
| markers | array | [] | Array of marker objects with value and label |
| onChange | function | - | Callback function that is triggered when the slider value changes |