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
NameTypeDefaultDetails
classNamestring' 'You can customise by passing tailwind classes.
labelClassNamestring' 'You can customise by passing tailwind classes.
sliderClassNamestring' 'You can customise by passing tailwind classes.
labelstring' 'You can pass label name to slider.
defaultValuenumber0You can pass default value to slider.
maxnumber100You can pass max value to slider.
stepnumber1You can pass step value to slider.
disabledbooleanfalseYou can pass disabled to slider.
onChange(value: number) => voidRequiredYou 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;