Dot Slider

A slider made of square dots that light up column by column, swelling as the fill moves forward, with an optional tick per column.

Volume50
Props
Color
theme
Rows3
Dot size4
Gap4
Min0
Max100

Installation

pnpm dlx shadcn@latest add @breeze/dot-slider

Usage

import { DotSlider } from "@/components/breeze/dot-slider"
<DotSlider label="Volume" defaultValue={64} suffix="%" />

Click anywhere in the tray to jump there, or drag to scrub. Arrow keys step through values (Shift for 10x), and Home and End jump to the ends.

Motion

As the fill moves forward, each newly lit column swells and settles, so a drag leaves a small wave behind its front; going back it just dims. The leading column grows a little while you hover, drag or focus, so it reads as the thumb, and on hover a dim column previews where a click would land. With reduced motion there's no swell.

Sound

Add sound for a soft tick each time the fill crosses a column. It's generated with WebAudio, so there's no file to ship, and it starts after the first interaction, as browsers require.

Examples

Settings

Volume64%
Warmth4030K
Speed1.20x

Props

PropTypeDefaultDescription
labelReactNodeShown above the tray with the value; also the accessible name
valuenumberControlled value
defaultValuenumber50Starting value when uncontrolled
onChange(value: number) => voidCalled with each new value
minnumber0Lowest value
maxnumber100Highest value
stepnumber1Value increment
colorstring"var(--brand)"Lit dot colour, any CSS colour or var()
rowsnumber3Rows of dots
dotSizenumber4Dot size in px
gapnumber4Space between dots in px
suffixstring""Text after the value, e.g. "%"
formatValue(value: number) => ReactNodeCustom value text
soundbooleanfalseA soft tick per column
disabledbooleanfalseDims it and ignores input