Documentation

  • 312 sections
  • Solid
  • Tailwind or StyleX

Switch

A toggle whose track is a dithered canvas: the accent gradient fills in when on, fades to a muted wash when off.

modelValue
Typeboolean Defaultnone
label
Typestring Defaultnone
color
TypePixelColor Default"blue"
seed
Typenumber Defaultnone
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
onUpdateModelValue
Type(value: boolean) => void Defaultnone
onClick
Type(event: MouseEvent & { currentTarget: HTMLButtonElement; target: Element }) => void Defaultnone
Add it to your project
One line copies DitherSwitch and every kit file they need into your project, in the styling system picked in the header.
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherSwitch

Checkbox

A pixel-border box that fills with the Bayer texture and draws a chunky near-white checkmark when checked. Label goes in as children.

modelValue
Typeboolean Defaultnone
onUpdateModelValue
Type(value: boolean) => void Defaultnone
color
TypePixelColor Default"blue"
seed
Typenumber Defaultnone
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
Add it to your project
One line copies DitherCheckbox and every kit file they need into your project, in the styling system picked in the header.
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherCheckbox

Slider

Drag or arrow-key the square thumb. The filled side of the track dithers denser toward the value, and the rest stays a muted rail.

Variants

gradient
dotted
hatched
solid
modelValue
Typenumber | [number, number] (array = range) Defaultnone
onUpdateModelValue
Type(value: number | [number, number]) => void Defaultnone
label
Typestring Defaultnone
min / max / step
Typenumber Default0 / 100 / 1
variant
Type"gradient" | "dotted" | "hatched" | "solid" Default"gradient"
ticks
Typeboolean (tick columns at steps if ≤25, else tenths) Defaultfalse
showValue
Typeboolean (bubble while dragging or focused) Defaultfalse
color
TypePixelColor Default"blue"
disabled
Typeboolean Defaultfalse
seed
Typenumber Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherSlider and every kit file they need into your project, in the styling system picked in the header.
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherSlider

Progress

A dithered fill that grows with value; set indeterminate to scroll a texture band instead (static under reduced motion). The bar below is bound to the slider above.

value
Typenumber Default0
color
TypePixelColor Default"blue"
seed
Typenumber Defaultnone
indeterminate
Typeboolean Defaultfalse
class
Typestring Defaultnone
aria-label
Typestring Defaultnone
aria-labelledby
Typestring Defaultnone
Add it to your project
One line copies DitherProgress and every kit file they need into your project, in the styling system picked in the header.
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherProgress