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.
Rendered live, with the same build of the library you install.
Slider.tsx
import { useState } from 'react';import { NSlider } from '@nayan-ui/react';const Slider = () => {const [value, setValue] = useState(50);return (<div><NSlider label="Volume" value={value} onChange={setValue} /></div>);};export default Slider;
| Name | Type | Default | Details |
|---|---|---|---|
| label | React.ReactNode | Optional | Label for the slider. |
| className | string | ' ' | You can customise by passing tailwind classes. |
| labelClassName | string | ' ' | You can customise by passing tailwind classes. |
| sliderClassName | string | ' ' | You can customise by passing tailwind classes. |
| id | string | Optional | ID for the slider. |
| value | number | Optional | Current slider value. |
| defaultValue | number | Optional | Default slider value. |
| min | number | Optional | Minimum slider value. |
| max | number | Optional | Maximum slider value. |
| step | number | Optional | Step increment for slider. |
| disabled | boolean | false | Whether the slider is disabled. |
| orientation | 'horizontal' | 'vertical' | Optional | Orientation of the slider. |
| onChange | (value: number) => void | Optional | Callback when value changes. |
| aria-label | string | Optional | ARIA label for accessibility. |
| aria-labelledby | string | Optional | ARIA labelledby for accessibility. |
| aria-valuetext | string | Optional | ARIA value text for accessibility. |
Other components solving nearby problems.
- React Slider
- React Carousel
- React Image Slider
- Responsive Slider in React
- React Range Slider
- React Slider Component
- Slider Animation in React
- React Multi-Item Slider
- React Autoplay Slider
- React Touch Slider
- React Slider with Hooks
- Custom React Slider
- Example Slider in React
- React Slider UI
- Slider with Thumbnails in React
- React Fade Slider
- React Image Carousel
- React Content Slider
- React Vertical Slider
- Slider Design in React