Documentation

  • 312 sections
  • Solid
  • Tailwind or StyleX

Heading

Semantic h1–h6 on the site's scale: level picks the size and weight, size draws it at another step when the outline and the look part (a card's title under a section: level 3, size 4), class overrides anything below.

level
Type1 | 2 | 3 | 4 | 5 | 6 Default2
size
Type1 | 2 | 3 | 4 | 5 | 6 Defaultlevel
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherHeading 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 DitherHeading

Label

A real <label> that pairs with controls through for (or by nesting), which is the whole point over a styled span. A required marker adds an asterisk that screen readers skip.

required
Typeboolean Defaultfalse
class
Typestring Defaultnone
Add it to your project
One line copies DitherLabel 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 DitherLabel

Caption

Supporting text in the caption register: 11px and muted, at AA contrast in either tone.

tone
Type"muted" | "faint" Default"muted"
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherCaption 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 DitherCaption

Overline

The tiny uppercase eyebrow above a section: 10px, open tracking, muted. Editorial structure without a heading's weight.

tone
Type"muted" | "faint" Default"muted"
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherHeading, DitherOverline 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 DitherHeading DitherOverline

Code

Inline code: the <code> element in house chrome. For the copyable block form, that's CodeBlock in the app layer; this one lives inside prose.

Add it to your project
One line copies DitherCode 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 DitherCode

KbdCombo

A shortcut as one readable unit: keys in Kbd chips with the separator between them. Single keys go through DitherKbd directly.

keys
Typestring[] Default['⌘', 'K']
separator
Typestring Default"+"
class
Typestring Defaultnone
Add it to your project
One line copies DitherKbdCombo 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 DitherKbdCombo

Blockquote

Real <blockquote> semantics with the editorial treatment: hairline left rule, muted register. Citations ride in the children.

Add it to your project
One line copies DitherBlockquote 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 DitherBlockquote

Highlight

The <mark> element with a neutral token wash. Colored variants belong in class because house color comes from palette seeds.

Add it to your project
One line copies DitherHighlight 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 DitherHighlight

Truncate

One-line ellipsis around any content. The native title attr rides through, so native tooltips stay one attribute away.

as
Typestring Default"span"
title
Typestring Defaultnone
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherTruncate 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 DitherTruncate

LineClamp

A block clamped after N lines (1–6) with a real ellipsis: excerpts, card bodies, previews that must not grow.

lines
Type1 | 2 | 3 | 4 | 5 | 6 Default3
as
Typestring Default"p"
class
Typestring Defaultnone
Add it to your project
One line copies DitherLineClamp 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 DitherLineClamp

MiddleEllipsis

Center-ellipsis for identifiers: paths, keys and hashes keep both ends, which is where recognition happens. The full string stays in title.

text
Typestring Default"…"
head
Typenumber (chars) Default8
tail
Typenumber (chars) Default6
title
Typeboolean Defaulttrue
class
Typestring Defaultnone
Add it to your project
One line copies DitherMiddleEllipsis 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 DitherMiddleEllipsis

EllipsisTooltip

Truncation with a tooltip that only earns itself: observes its own overflow (ResizeObserver, zero forced reads) and publishes title only while clipped. Unclipped content gets no tooltip, which is the point.

enabled
Typeboolean Defaulttrue
as
Typestring Default"span"
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherEllipsisTooltip 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 DitherEllipsisTooltip

SelectableText

Text that selects itself on click (user-select: all) for license keys, tokens and one-tap copy targets. Wraps any inline content.

as
Typestring Default"span"
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherSelectableText 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 DitherSelectableText

CopyableText

One-tap copy around a piece of text. The value goes through the shared Clipboard primitive (live region included); the trigger flips from Copy to Check.

value
Typestring Defaultrequired
label
Typestring (aria) Default"Copy"
size
Typenumber (px) Default14
class
Typestring Defaultnone
children
TypeJSX.Element | ((scope: { readonly copied: boolean }) => JSX.Element) Defaultnone
Add it to your project
One line copies DitherCopyableText 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 DitherCopyableText

NumberText

Locale-aware numbers: grouping, decimals and locale through Intl, and tabular-nums so columns line up.

value
Typenumber Defaultrequired
decimals
Typenumber (min = max) Defaultnatural
locale
Typestring Default"en-US"
grouping
Typeboolean Defaulttrue
class
Typestring Defaultnone
Add it to your project
One line copies DitherNumberText 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 DitherNumberText

CurrencyText

Money through Intl. Symbol placement and grammar are the runtime's job; ours is picking currency, locale and decimals.

value
Typenumber Defaultrequired
currency
Typestring (ISO 4217) Default"USD"
locale
Typestring Default"en-US"
decimals
Typenumber Default2
class
Typestring Defaultnone
Add it to your project
One line copies DitherCurrencyText 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 DitherCurrencyText

PercentText

Ratio to percent. The input is the fraction (0.42 becomes 42%) because that is what Intl's percent style expects; decimals default to zero for the clean read.

value
Typenumber (fraction) Defaultrequired
decimals
Typenumber Default0
locale
Typestring Default"en-US"
class
Typestring Defaultnone
Add it to your project
One line copies DitherPercentText 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 DitherPercentText

FileSizeText

Bytes to human units, 1024-based the way disk tools actually count. Sub-KB sizes stay whole numbers, signs survive.

bytes
Typenumber Default0
decimals
Typenumber (≥ 1KB) Default1
locale
Typestring Default"en-US"
class
Typestring Defaultnone
Add it to your project
One line copies DitherFileSizeText 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 DitherFileSizeText

DurationText

Milliseconds to a smart human duration: precision drops as magnitude grows. No zero-padding, no clutter.

ms
Typenumber Default0
class
Typestring Defaultnone
Add it to your project
One line copies DitherDurationText 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 DitherDurationText

RelativeTime

<time> in the relative register: Intl.RelativeTimeFormat picks the largest sane unit and numeric: "auto" turns zero into "now". It re-ticks on an interval so a live list stays honest; pass now to freeze the clock.

date
TypeDate | string | number Defaultrequired
locale
Typestring Default"en-US"
auto
Typeboolean (re-tick) Defaulttrue
now
Typenumber (frozen clock) DefaultDate.now()
updateInterval
Typenumber (ms) Default30000
class
Typestring Defaultnone
Add it to your project
One line copies DitherRelativeTime 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 DitherRelativeTime

DateTimeText

Date to localized text with the medium-date + short-time register by default; any Intl.DateTimeFormatOptions shape overrides it (bring timeZone in the options for deterministic rendering). An unparseable date renders an em dash: visible, not silent.

date
TypeDate | string | number Default""
locale
Typestring Default"en-US"
options
TypeIntl.DateTimeFormatOptions Defaultmedium date + short time
class
Typestring Defaultnone
Add it to your project
One line copies DitherDateTimeText 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 DitherDateTimeText

PluralText

Intl.PluralRules as a prop switch: the plural category picks the prop, children is the fallback, and every one receives count. Richer plural languages just get more named props. No conditionals in the caller.

count
Typenumber Default0
locale
Typestring (BCP 47) Default"en"
class
Typestring Defaultnone
zero / one / two / few / many / other / children
Type({ count }) => JSX.Element, named by category: one, few, many… + children Defaultchildren
Add it to your project
One line copies DitherPluralText 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 DitherPluralText

Emoji

An emoji as an image with a real accessible name: role="img" + aria-label gives screen readers one predictable announcement instead of whatever the glyph's unicode name happens to be. Pass the character, pass what it means here.

char
Typestring (unicode) Default"✨"
label
Typestring (aria) Default""
class
Typestring Defaultnone
Add it to your project
One line copies DitherEmoji 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 DitherEmoji