Slider
Swipe left or right to adjust values, like sliding the volume on your stereo, perfect for gradual control.
Slider
A slider is a horizontal bar that you can drag left or right to select a value within a range, similar to adjusting volume.
Preview
Code
Installation
CLI
Manual
npx hq-kit add slider
Step
Set a step value on the slider, and it will increment or decrement by that fixed amount each time you adjust it.
Preview
Code
Range
By passing an array to the defaultValue
or value
props, you can create a range slider.
Preview
Code
Controlled
You can control the slider's value by using the value
prop.
Preview
Code
Orientation
You can change the orientation of the slider to vertical.
Preview
Code
Suffix Prefix
Sometimes you need to add a prefix or suffix to the slider, like a volume icon.
Preview
Code
Disabled
When the slider is disabled, it appears grayed out and becomes non-interactive.
Preview
Code