Slider

A range input with a smooth draggable thumb, built on Radix UI Slider. Supports controlled and uncontrolled usage, custom step sizes, and min/max bounds.

Value: 40

Usage

import { Slider } from "@bloomkit/react";
 
<Slider
  defaultValue={[50]}
  min={0}
  max={100}
  step={1}
  onValueChange={(value) => console.log(value)}
/>

Controlled

const [value, setValue] = useState([40]);
 
<Slider
  value={value}
  onValueChange={setValue}
  min={0}
  max={200}
  step={5}
/>

Props

PropTypeDefaultDescription
valuenumber[]Controlled value (array supports range sliders in future)
defaultValuenumber[]Initial value for uncontrolled usage
onValueChange(value: number[]) => voidCallback fired when the value changes
minnumber0Minimum value of the slider
maxnumber100Maximum value of the slider
stepnumber1Increment step between values
disabledbooleanfalseDisable interaction with the slider
classNamestringAdditional Tailwind classes