Get Started
Components
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
Usage
import { NSlider } from '@nayan-ui/react';const Slider = () => {return (<NSlider defaultValue={50} max={100} step={1} disabled={false} onChange={value => console.log(value)} />);};export default Slider;
Attributes
| 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. |