ComponentsForm
Slider Control
A labeled slider with inline value display, composing Slider with a label and formatted output.
Default
A slider with a label and formatted value display.
Decimal Step
Use fractional steps for fine-grained control.
Installation
npx visor add slider-controlThis copies two files into your project:
components/ui/slider-control/slider-control.tsx— the componentcomponents/ui/slider-control/slider-control.module.css— the styles
Usage
import { SliderControl } from '@/components/ui/slider-control/slider-control';
const [scale, setScale] = useState(1.0);
<SliderControl
label="Size"
value={scale}
onValueChange={setScale}
displayValue={scale.toFixed(1)}
min={0.2}
max={3.0}
step={0.05}
/>API Reference
SliderControlProps
No props data available for “slider-control”.
The component also accepts all standard <div> HTML attributes.
Accessibility
- Composes the Slider primitive which uses
role="slider"witharia-valuemin,aria-valuemax, andaria-valuenow. - The label is associated with the slider for screen reader announcements.
- Keyboard:
ArrowLeft/ArrowRightadjust the value bystep;Home/Endjump to min/max.