Slider

Radix slider with a wobbly track line and a sketch thumb. The filled range is a second, rougher stroke.

<Slider defaultValue={[40]} thumbShape="circle" roughness={1.5} />

CLI install

npx doodleui-react add slider

Usage

import { Slider } from "doodleui-react";

<Slider defaultValue={[40]} min={0} max={100} />

Pointer, keyboard, and aria-valuenow come from Radix. doodle-ui only skins the track and thumb.

Props

PropTypeDefaultNotes
value / defaultValuenumber[]required (defaultValue)Radix slider values. Use a one-item array for a single thumb.
min / max / stepnumber0 / 100 / 1Range bounds and increment.
thumbShape"circle" | "square""circle"Rough thumb geometry.
roughnessnumber1.5How wobbly the stroke is. 0 is almost geometric. 3+ is messy.
seednumberprovider / randomLocks the sketch. Omit to follow SketchSeedProvider (Shuffle) or a mount-time random seed.
sketchColorstring#1f1d1aStroke color. Also tints primary/accent fills where relevant.
classNamestringundefinedPassed through to the root element.
styleCSSPropertiesundefinedPassed through to the root element.