Slider

A styled range input for selecting a numeric value within a defined range, with optional label, hint, and current value display.

Installation

npx dafink-ui add slider

Demo

Drag or use arrow keys to adjust.

Props

NameTypeDefaultDescription
valuenumber-Controlled current value.
onValueChange(value: number) => void-Called with the new numeric value on change.
minnumber0Minimum value.
maxnumber100Maximum value.
stepnumber1Increment between selectable values.
disabledbooleanfalseDisables the slider.
labelstring-Visible label above the track; links to the input via id.
hintstring-Helper text below the track.
showValuebooleanfalseShows the current numeric value next to the label.
size'default' | 'sm''default'"sm" renders a shorter row and thinner track for dense layouts.
tone'brand' | 'current''brand'"current" derives track/fill/thumb color from currentColor instead of the brand token, for sliders placed on an arbitrary colored surface (e.g. inside a colored chat bubble).
ariaLabelstring-Sets aria-label on the input directly; use when there is no visible label.
ariaValueTextstring-Overrides the announced value with a custom string, e.g. a formatted timestamp.
classNamestring""Additional classes merged onto the root wrapper.