Documentation

  • 312 sections
  • Solid
  • Tailwind or StyleX

Accordion

A stack of disclosure rows animated through grid-template-rows, each with the 2px dithered rail. Single type closes siblings on open.

items
Type{ value: string; title: string }[] Defaultnone
modelValue
Typestring | string[] Defaultnone
type
Type"single" | "multiple" Default"single"
color
TypePixelColor Default"blue"
onUpdateModelValue
Type(value: string | string[]) => void Defaultnone
slots
TypeRecord<string, JSX.Element> Defaultnone
Add it to your project
One line copies DitherAccordion 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 DitherAccordion

Alert dialog

A modal that demands an answer: overlay clicks do nothing, Escape cancels, and focus lands on the safe Cancel button. Danger seeds the confirm fill red.

open
Typeboolean Defaultnone
title
Typestring Defaultnone
description
Typestring Defaultundefined
confirmLabel
Typestring Default"Confirm"
cancelLabel
Typestring Default"Cancel"
danger
Typeboolean Defaultfalse
onConfirm
Type() => void Defaultnone
onCancel
Type() => void Defaultnone
Add it to your project
One line copies DitherAlertDialog, DitherButton 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 DitherAlertDialog DitherButton

Drawer

A side panel that slides in over a scrim. Escape or scrim click closes, the close button takes focus on open.

Swipe to open

DitherSwipeArea is an invisible strip on the viewport edge. Arm it, then swipe inward from the right edge of your screen to open the drawer.

arm edge
open
Typeboolean Defaultnone
side
Type"right" | "left" | "bottom" Default"right"
title
Typestring Defaultundefined
swipe
Typeboolean: swipe to dismiss, momentum decides Defaulttrue
snapPoints
Typenumber[]: ≤1 vh fraction, >1 px (bottom) Defaultundefined
snapPoint
Typenumber (with onUpdateSnapPoint) Defaultfirst snap
modal
Typeboolean (false: no backdrop, page stays live) Defaulttrue
dismissible
Typeboolean (false: backdrop click ignored) Defaulttrue
onClose
Type() => void Defaultnone
onUpdateSnapPoint
Type(snap: number) => void Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherButton, DitherDrawer, 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 DitherButton DitherDrawer DitherSwitch

Toast

A module-level toast() call feeds a portalled bottom-right stack; each toast carries a 3px dithered rail in its color and dismisses itself after its duration. API table below documents the toast() function.

message
Typestring Defaultnone
opts.color
TypePixelColor Default"blue"
opts.duration
Typenumber Default3500
Add it to your project
One line copies DitherButton, DitherToaster 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 DitherButton DitherToaster

Meter

A static gauge on the progress track. The fill seed picks itself: green below the low mark, orange between, red above the high mark.

value
Typenumber Defaultnone
min
Typenumber Default0
max
Typenumber Default100
low
Typenumber Default0.5
high
Typenumber Default0.8
class
Typestring Defaultnone
Add it to your project
One line copies DitherMeter 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 DitherMeter

Gauge

An instrument dial. The band prints cell by cell through the threshold matrix, filled to the needle; past the warn mark the zone is in the warning ink. A changed value settles on the spring, and under reduced motion the needle simply stands on it.

Instruments that read something real: this page's frame rate, its worst frame in the last half second (past 33ms a frame drops) and how many elements it holds, read while the panel is on screen.

value
Typenumber Defaultnone
min
Typenumber Default0
max
Typenumber Default100
ticks
Typenumber (intervals between major ticks) Default10
warn
Typenumber | null (where the zone starts, 0..1) Default0.8
label
Typestring (under the reading, its accessible name) Defaultundefined
decimals
Typenumber Default0
color
TypePixelColor Default"grey"
warnColor
TypePixelColor (the zone and the hub) Default"orange"
seed
Typenumber Defaultundefined
class
Typestring Defaultnone
Add it to your project
One line copies DitherGauge, DitherSlider, DitherInView 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 DitherGauge DitherSlider DitherInView

Scope

An oscilloscope screen. The beam prints through the threshold matrix, bright where it moves slowly and faint on its edges, and a named wave drifts with a trail of its earlier phases. Give it samples and it traces those. Under reduced motion, or off screen, it holds still.

signal
Type"sine" | "square" | "triangle" | "saw" | number[] (samples, -1..1) Default"sine"
cycles
Typenumber (of a named wave across the screen) Default2
speed
Typenumber (cycles a second; 0 holds it) Default0.5
gain
Typenumber (1 fills the screen) Default0.8
afterglow
Typenumber (0..1, the trail of earlier phases) Default0.6
label
Typestring (in the corner, its accessible name) Defaultundefined
color
TypePixelColor Default"green"
seed
Typenumber Defaultundefined
class
Typestring Defaultnone
Add it to your project
One line copies DitherScope, DitherSlider, DitherToggleGroup 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 DitherScope DitherSlider DitherToggleGroup

Scroll area

An honest overflow container: no canvas, just thin token-colored scrollbars that match the house border.

class
Typestring Defaultundefined
children
Typecontent Defaultnone
Add it to your project
One line copies DitherScrollArea 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 DitherScrollArea

Toolbar

A roving-tabindex strip: one Tab stop for the whole bar, arrow keys walk the buttons, Home and End jump to the edges.

label
Typestring Defaultundefined
children
Typecontent Defaultnone
Add it to your project
One line copies DitherToolbar, DitherButton, DitherSeparator 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 DitherToolbar DitherButton DitherSeparator