Documentation
- 312 sections
- Solid
- Tailwind or StyleX
Box
One element, one job: a typed container whose whole style arrives as class. Swap the tag with as (landmarks for structure, spans for inline flow) and its children never notice.
- as
- Type"div" | "section" | "span" | "article" | … Default"div"
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherBoxText
The type scale the whole site speaks: three token tones, four sizes from 11 to 15px, and as for the element. Leading, tracking and weight stay yours in class.
- as
- Type"p" | "span" | "h3" | "li" | … Default"p"
- tone
- Type"default" | "muted" | "faint" Default"default"
- size
- Type"xs" | "sm" | "md" | "lg" (11–15px) Defaultnone
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherTextDivider
A hairline rule with real separator semantics. Horizontal renders an hr; vertical lives in flex rows and stretches to their height. Both announce their orientation.
- orientation
- Type"horizontal" | "vertical" Default"horizontal"
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherDivider DitherTextSvg
A neutral SVG shell: no imposed stroke language, so the kit's art direction stays inside the components. Decorative by default (aria-hidden); a label promotes it to role="img" with a name.
- viewBox
- Typestring Defaultnone
- label
- Typestring (promotes to role=img) Defaultnone
- class
- Typestring Defaultnone
- children
- Typecontent Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherSvgImage
The plain img with the modern loading contract baked in: lazy, async decode, and a required alt (empty string is the explicit decorative choice). For the ordered-dither renderer see Image in Components.
- src
- Typestring Defaultrequired
- alt
- Typestring (empty string = decorative) Defaultrequired
- loading
- Type"lazy" | "eager" Default"lazy"
- decoding
- Type"async" | "auto" | "sync" Default"async"
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherImgSpacer
Sized empty space for flex and grid rows, the alternative to magic margins. Two axes, five steps from 4 to 40px, always decorative.
- axis
- Type"y" | "x" Default"y"
- size
- Type"xs" | "sm" | "md" | "lg" | "xl" (4–40px) Default"md"
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherSpacerPortal
Portal by name: render children elsewhere in the DOM so popovers and toasts escape overflow: hidden. disabled keeps it in place (the switch for tests and environments where the target does not exist); defer waits for the rest of the render, so the target can come later in the same markup, as it does here.
- to
- Typestring (selector) Default"body"
- disabled
- Typeboolean Defaultfalse
- defer
- Typeboolean (the target may come later in the markup) Defaultfalse
- children
- Typecontent Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherPortalOverlay
A full-cover layer in four dim weights. Decorative and click-transparent by default; interactive makes it catch presses (dismissible scrims) and lifts the aria-hidden so its children stay reachable.
- dim
- Type"none" | "soft" | "medium" | "strong" Default"soft"
- interactive
- Typeboolean Defaultfalse
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherOverlayMeasure
Reports its own box: a plain block that calls onResize with width and height on every change. ResizeObserver only: without it the children still render and it simply stays silent.
- onResize
- Type({ width, height }) => void Defaulton box change
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherMeasureClipboard
Clipboard behavior around any trigger: the function child gets copied and copy, and a polite live region announces the result. Your trigger keeps its own semantics. This adds the behavior and the announcement.
- value
- Typestring Defaultrequired
- disabled
- Typeboolean Defaultfalse
- onCopied
- Type(value) => void Defaulton success
- children
- Type(scope: ClipboardScope) => JSX.Element Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherClipboardClickOutside
One outside event when a primary press lands anywhere beyond the wrapped content: capture-phase pointerdown, so nested scroll containers and shadowed children are handled by containment, not by guessing.
- enabled
- Typeboolean Defaulttrue
- class
- Typestring Defaultnone
- onOutside
- Type(event) => void: pointerdown outside Defaultnone
- children
- Typecontent Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherClickOutsideFocusRing
Container-level focus: wraps a control group and rings while anything inside holds focus, so keyboard users see which group is active. The individual control keeps the global :focus-visible floor.
- class
- Typestring Defaultnone
- children
- TypeJSX.Element Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherFocusRingFocusScope
The modal focus contract in one component: focus enters on mount, Tab cycles inside the scope, and closing hands focus back to whatever had it. Every dialog in the kit obeys exactly these three rules.
- autofocus
- Typeboolean Defaulttrue
- trapped
- Typeboolean Defaulttrue
- restoreFocus
- Typeboolean Defaulttrue
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherFocusScopeHoverArea
Hover state as function-child data: no refs, no listener bookkeeping. Keyboard focus tracks alongside the pointer so the reveal is the same for everyone.
- children
- Type({ hovered, focused }) => JSX.Element Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherHoverAreaPressable
A native button (never submits a form by accident) with the house press affordance and the theme's focus ring that looks like a button out of the box: solid ink by default, outline or ghost beside it, and plain for the bare base when you draw every pixel yourself. For the dithered, blooming version see DitherButton.
- variant
- Type"solid" | "outline" | "ghost" | "plain" Default"solid"
- type
- Type"button" | "submit" | "reset" Default"button"
- disabled
- Typeboolean Defaultfalse
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherPressableInView
The taxonomy's IntersectionObserver primitive, named for what it does: visibility as function-child state. once latches after the first enter (the lazy-reveal shape this whole page runs on). Degraded engines see content, never an empty box.
- rootMargin
- Typestring Default"200px"
- threshold
- Typenumber Default0
- once
- Typeboolean Defaulttrue
- class
- Typestring Defaultnone
- onEnter
- Type() => void Defaultnone
- onLeave
- Type() => void Defaultnone
- children
- Type({ inView }) => JSX.Element Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherInViewIcon
87 glyphsThe hand-rolled set: 24×24 stroke geometry, currentColor, round caps. One source in icons.ts, no dependencies. Decorative by default; a label names it for screen readers. Unknown names throw instead of rendering an empty box.
- name
- TypeIconName (glyph list in icons.ts) Defaultrequired
- size
- Typenumber (px) Default16
- label
- Typestring (promotes to role=img) Defaultnone
- strokeWidth
- Typenumber Default2
- class
- Typestring Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherIconIconSet
The same set as <symbol> sheets: mount once and reference glyphs with <use href="#di-icon-Name"> when a screen repeats icons enough to care. Opt-in: DitherIcon never needs it.
- use
- Typevia <use href="#di-icon-Name"> Defaultnone
curl -fsSL https://dither-ui.com/add/dither-add.mjs | node --input-type=module - add DitherIconSet