Slider
A native range control with a required accessible label.
Interactive preview
Usage
import { Slider, Label } from "@devvy-ui/react";
<Label htmlFor="volume">Volume</Label>
<Slider id="volume" label="Volume" defaultValue={40} min={0} max={100} />API reference
Native HTML attributes, className, style and a forwarded ref are supported. Component-specific props:
| Prop | Type | Default | Description |
|---|---|---|---|
| label | string | required | Accessible measurement name. |
| min / max / step | native input values | 0 / 100 / 1 | Native range constraints. |
| value / defaultValue / onChange | native input props | — | Controlled/initial value and native change event. |
Accessibility & behavior
Platform Behavior & Guidelines
Native range provides Arrow, Home/End and pointer/touch behavior. Use event.currentTarget.valueAsNumber for numeric state. Show visible context and units; native validity/disabled/name/ref attributes are retained. CSS accent-color follows the theme.
Source ownership
Run npx @devvy-ui/cli init once in your React project, then add the source:
npx @devvy-ui/cli add sliderMake the source yours.
Start from the canonical implementation used by the package and registry. Change the code, keep the MIT notice, and build the behavior your project needs.
Edit your own copy. Downloaded source uses your changes; the component preview above uses the shipped version. Run the source installer first to include shared helpers.