v0.3.1 StableFoundation ComponentReact 18 & 19Zero Runtime CSS

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:

PropTypeDefaultDescription
labelstringrequiredAccessible measurement name.
min / max / stepnative input values0 / 100 / 1Native range constraints.
value / defaultValue / onChangenative 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 slider

Make 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.

Slider.tsxREACT / TSX

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.