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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherAccordionAlert 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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherAlertDialog DitherButtonDrawer
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.
- 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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherButton DitherDrawer DitherSwitchToast
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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherButton DitherToasterMeter
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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherMeterGauge
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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherGauge DitherSlider DitherInViewScope
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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherScope DitherSlider DitherToggleGroupScroll area
An honest overflow container: no canvas, just thin token-colored scrollbars that match the house border.
- class
- Typestring Defaultundefined
- children
- Typecontent Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherScrollAreaToolbar
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
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherToolbar DitherButton DitherSeparator