Get Started
Components
Dev Tools
More Guides
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
# Attributes
Name | Type | Default | Details |
---|---|---|---|
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. |
label | string | ' ' | You can pass label name to slider. |
defaultValue | number | 0 | You can pass default value to slider. |
max | number | 100 | You can pass max value to slider. |
step | number | 1 | You can pass step value to slider. |
disabled | boolean | false | You can pass disabled to slider. |
onChange | (value: number) => void | Required | You can get callback when slider changed. |
# Usage
import { NSlider } from 'nayan';
const Slider = () => {
return (
<NSlider defaultValue={50} max={100} step={1} disabled={false} onChange={value => console.log(value)} />
);
};
export default Slider;
# Tags