Slider

A Slider component allows users to select a value from a range by dragging a thumb along a track. Built on top of heroui-native Slider.

Demo

Demo Coming Soon

Slider examples will be available soon.

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

NameTypeDefaultDetails
valuenumberOptionalControlled slider value.
defaultValuenumberOptionalDefault slider value.
onChange(value: number) => voidOptionalCallback when slider value changes.
minValuenumber0Minimum value of the slider.
maxValuenumber100Maximum value of the slider.
stepnumber1Step increment of the slider.
isDisabledbooleanfalseWhether the slider is disabled.
showOutputbooleanfalseWhether to show the current value output.
classNamestring' 'You can customise by passing tailwind classes.
trackClassNamestring' 'You can customise track by passing tailwind classes.
fillClassNamestring' 'You can customise fill by passing tailwind classes.
thumbClassNamestring' 'You can customise thumb by passing tailwind classes.