Documentation

  • 312 sections
  • Solid
  • Tailwind or StyleX

Animated content

Wrap anything to have it slide and fade into place the first time it enters the viewport. Direction, distance and timing are configurable, and distance takes CSS lengths too: distance="4cqw" reveals from 4% of the nearest query container, so the motion measures its parent instead of pixels.

distance
Typenumber (px) | CSS length: "4cqw" rides the nearest query container Default40
direction
Type"vertical" | "horizontal" Default"vertical"
reverse
Typeboolean Defaultfalse
duration
Typenumber (ms) Default800
delay
Typenumber (ms) Default0
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherAnimatedContent 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 DitherAnimatedContent

Fade content

A pure fade-in on view, optionally de-blurring as it appears. The lighter cousin of Animated content when you only want opacity.

duration
Typenumber (ms) Default1000
delay
Typenumber (ms) Default0
blur
Typeboolean Defaultfalse
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherFadeContent 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 DitherFadeContent

Gradual blur

A masked backdrop-filter strip that progressively blurs toward an edge: the iOS-style soft fade over a scroll region.

position
Type"bottom" | "top" Default"bottom"
height
Typenumber (px) Default96
strength
Typenumber (px) Default4
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherGradualBlur 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 DitherGradualBlur

Star border

A rounded frame with two bright glints traveling its top and bottom edges: a subtle animated outline for a CTA or badge.

color
Typestring (hex) Default"#7CFF67"
speed
Typenumber (s) Default6
thickness
Typenumber (px) Default1
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherStarBorder 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 DitherStarBorder

Electric border

An SVG turbulence filter jitters the frame edge into a crackling electric outline. Reduced motion drops the displacement.

color
Typestring (hex) Default"#5227FF"
speed
Typenumber Default1
thickness
Typenumber (px) Default2
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherElectricBorder 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 DitherElectricBorder

Glare hover

A diagonal sheen sweeps across the surface on hover: the glossy-card reflection, done with a single masked gradient. Hover the card.

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

Magnet

The wrapped element is pulled toward the pointer while it is within range, easing back when the cursor leaves. Move your cursor near the button.

strength
Typenumber (0-1) Default0.4
radius
Typenumber (px) Default200
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherMagnet 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 DitherMagnet

Click spark

A burst of spark lines radiates from every click inside the area, drawn on a lightweight canvas overlay. Click anywhere in the preview.

color
Typestring (hex) Default"#7CFF67"
count
Typenumber Default8
size
Typenumber (px) Default16
duration
Typenumber (ms) Default420
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherClickSpark 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 DitherClickSpark

Blob cursor

A soft, screen-blended blob eases toward the pointer inside the area: a gooey cursor companion. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
size
Typenumber (px) Default48
lag
Typenumber (0-1) Default0.18
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherBlobCursor 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 DitherBlobCursor

Crosshair

Full-height and full-width guide lines track the pointer across the area: a precision reticle. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
thickness
Typenumber (px) Default1
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherCrosshair 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 DitherCrosshair

Ghost cursor

A tapering trail of fading dots chases the pointer on a canvas overlay. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
count
Typenumber Default18
size
Typenumber (px) Default10
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherGhostCursor 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 DitherGhostCursor

Splash cursor

Expanding ripple rings bloom along the pointer path, like drops on water. Move your cursor over the box.

color
Typestring (hex) Default"#3DA5FF"
maxRadius
Typenumber (px) Default60
duration
Typenumber (ms) Default700
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherSplashCursor 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 DitherSplashCursor

Target cursor

A slowly rotating corner-bracket reticle locks onto the pointer: a HUD targeting frame. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
size
Typenumber (px) Default36
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherTargetCursor 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 DitherTargetCursor

Pixel trail

The pointer lights up cells of a pixel grid that then fade back out: a glowing wake across the lattice. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
gap
Typenumber (px) Default24
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherPixelTrail 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 DitherPixelTrail

Image trail

Tiles from a palette drop along the pointer path, rotating and shrinking as they fade. Pass real image URLs via colors swapped for tiles here. Move your cursor over the box.

colors
Typestring[] (hex) Default['#5227FF', '#7CFF67', ...]
size
Typenumber (px) Default40
duration
Typenumber (ms) Default650
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherImageTrail 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 DitherImageTrail

Meta balls

Orbiting blobs fuse into a gooey metaball iso-surface, tinted and ordered-dithered through the kit engine. The pointer adds a blob.

colors
Typestring[] (hex) Default['#5227FF', '#7CFF67', '#3DA5FF']
count
Typenumber Default6
speed
Typenumber Default1
ballSize
Typenumber Default1
glow
Typenumber Default1.5
mouseInteraction
Typeboolean Defaulttrue
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherMetaBalls 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 DitherMetaBalls

Metallic paint

Iterative domain-warped reflections read as flowing liquid chrome. Fully opaque, dithered across a metallic ramp.

colors
Typestring[] (hex) Default['#1A1A22', '#8890A0', '#E8ECF4']
scale
Typenumber Default3
speed
Typenumber Default0.4
distortion
Typenumber Default0.6
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherMetallicPaint 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 DitherMetallicPaint

Noise

Animated hashed grain thresholded against the Bayer matrix: living static for a texture overlay. Tune density and blend it over content.

colors
Typestring[] (hex) Default['#3DA5FF', '#7CE0FF', '#FFFFFF']
speed
Typenumber Default1
density
Typenumber (0-1) Default0.5
opacity
Typenumber (0-1) Default1
paused
Typeboolean Defaultfalse
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultnone
seed
Typenumber Defaultnone
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherNoise 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 DitherNoise

Cubes

A rhombille tiling shades into a field of isometric cubes, each face lit and pulsing on noise. Tinted and ordered-dithered.

colors
Typestring[] (hex) Default['#5227FF', '#7CFF67', '#CFFFDF']
scale
Typenumber Default6
speed
Typenumber Default0.4
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherCubes 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 DitherCubes

Ribbons

Thick flowing bands ride wavy fbm centerlines, bright at the core and tinted per ribbon. The pointer bends nearby ribbons toward it.

colors
Typestring[] (hex) Default['#5227FF', '#7CFF67', '#3DA5FF']
count
Typenumber Default5
speed
Typenumber Default0.5
thickness
Typenumber Default0.12
amplitude
Typenumber Default1
glow
Typenumber Default1.2
mouseInteraction
Typeboolean Defaulttrue
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
mouseStrength
Typenumber Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherRibbons 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 DitherRibbons

Shape blur

A big soft blob morphs on noise and drifts toward the pointer: a gentle out-of-focus shape. Move your cursor over it.

colors
Typestring[] (hex) Default['#5227FF', '#7CFF67']
size
Typenumber Default0.4
speed
Typenumber Default0.6
softness
Typenumber Default0.3
mouseInteraction
Typeboolean Defaulttrue
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
mouseStrength
Typenumber Default0.5
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherShapeBlur 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 DitherShapeBlur

Strands

Dozens of thin filaments sway on fbm like blown hair, tinted by depth and ordered-dithered with transparent gaps.

colors
Typestring[] (hex) Default['#5227FF', '#7CE0FF']
count
Typenumber Default40
speed
Typenumber Default0.4
sway
Typenumber Default0.15
lineWidth
Typenumber Default0.01
glow
Typenumber Default1
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherStrands 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 DitherStrands

Laser flow

Sharp horizontal beams sweep with additive bloom and a faint jitter, tinted per beam: a scanning laser array.

colors
Typestring[] (hex) Default['#FF3D2E', '#FFD23D', '#FFFFFF']
count
Typenumber Default4
speed
Typenumber Default0.6
beamWidth
Typenumber Default0.02
glow
Typenumber Default1
opacity
Typenumber (0-1) Default1
dither
Typenumber (0-1) | boolean Default1
paused
Typeboolean Defaultfalse
dpr
Typenumber Defaultnone
mixBlendMode
Typestring Defaultundefined
seed
Typenumber Defaultundefined
frameRate
Typenumber (fps, stop-motion) Default0 (smooth)
renderMode
Type"live" | "static" Default"live"
precompiled
Typestring | { src: string; width?: number; height?: number } Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherLaserFlow 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 DitherLaserFlow

Antigravity

A field of motes drifts upward and wraps: gravity in reverse, layered behind your content.

color
Typestring (hex) Default"#7CFF67"
count
Typenumber Default40
speed
Typenumber Default1
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherAntigravity 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 DitherAntigravity

Logo loop

A seamless infinite marquee of items. Pass logos or wordmarks and it loops forever with a measured wrap.

items
Typestring[] Default['DITHER', 'BAYER', ...]
speed
Typenumber (s) Default18
gap
Typenumber (px) Default48
class
Typestring Defaultnone
Add it to your project
One line copies DitherLogoLoop 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 DitherLogoLoop

Magic rings

Concentric rings pulse outward from the center on a stagger: a radar-ping halo around whatever you wrap.

color
Typestring (hex) Default"#7CFF67"
count
Typenumber Default4
duration
Typenumber (s) Default3
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherMagicRings 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 DitherMagicRings

Magnet lines

A grid of little needles all swivel to point at the pointer, like iron filings over a magnet. Move your cursor over the box.

color
Typestring (hex) Default"#7CFF67"
gap
Typenumber (px) Default28
lineLength
Typenumber (px) Default14
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherMagnetLines 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 DitherMagnetLines

Orbit images

Items ride a circular orbit around a center point. Pass avatars, logos or labels. Counter-rotated so they stay upright.

items
Typestring[] Default['A', 'B', 'C', 'D', 'E']
radius
Typenumber (px) Default80
duration
Typenumber (s) Default16
size
Typenumber (px) Default200
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherOrbitImages 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 DitherOrbitImages

Pixel transition

A grid of pixel cells covers the content and dissolves in a scattered order on hover, revealing what is underneath. Hover the card.

rows
Typenumber Default6
cols
Typenumber Default10
color
Typestring (hex) Default"#111318"
class
Typestring Defaultnone
children
Typecontent Defaultnone
Add it to your project
One line copies DitherPixelTransition 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 DitherPixelTransition

Dither reveal

Any content comes in through an ordered-dither mask. A dissolve resolves cell by cell in the Bayer order; a wipe moves a solid front with a dithered band behind it. The mask is a pure function of progress, so a seeked frame (the player, a video export) gets the same cells every time, and the Studio's reels cut between frames with it. Pass progress to drive it from your own timeline.

progress
Typenumber 0–1 (manual; unset plays on the clock) Defaultnone
duration
Typenumber (s) Default1.2
delay
Typenumber (s) Default0
direction
Type'none' | 'right' | 'left' | 'down' | 'up' | 'iris' Default'none' (dissolve)
cell
Typenumber (px) Default4
band
Typenumber (cells; directional wipes) Default12
seed
Typenumber (a seeded 4×4 matrix) Defaultnone (Bayer 8×8)
reverse
Typeboolean (hide instead) Defaultfalse
easing
TypeEasingInput Default'ease-in-out'
restartKey
Typeunknown (change to replay) Defaultnone
class
Typestring Defaultnone
children
Typecontent Defaultnone
aria-hidden
Typeboolean | "true" | "false" Defaultnone
data-phase
Typestring Defaultnone
Add it to your project
One line copies DitherReveal 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 DitherReveal

Page transition

One state turns into the next through the same masks. ditherTransition runs any DOM change as a view transition and dithers its two snapshots, the old one breaking up as the new one resolves, with an ink riding the front between them. Give it a target to change one element while the page stays live, or none for the whole page: this site moves between its pages and turns its theme that way. Without the View Transitions API, under reduced motion or while the clock is directed, the change just happens.

update
Type() => void | Promise<void> (the change) Defaultnone
direction
Type'none' | 'right' | 'left' | 'down' | 'up' | 'iris' Default'none' (dissolve)
origin
Type{ x, y } (viewport px; the iris's centre) Defaultthe box's centre
cell
Typenumber (px) Default6
band
Typenumber (cells) Default10
seed
Typenumber (a seeded 4×4 matrix) Defaultnone (Bayer 8×8)
ink
Typestring (a CSS colour between the two) Defaultnone
duration
Typenumber (ms) Default600
easing
TypeEasingInput Default'ease-in-out'
target
TypeHTMLElement (the element that changes) Defaultthe whole page

Sticker peel

A corner of the card peels up on hover with a soft curl shadow: the sticker lift. Hover the card.

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

Expand tabs

An icon bar where only the active tab unfolds its label. The rest stay square glyphs. The label slides through the house 0fr grid trick.

tabs
Type{ value, label, color? }[] Defaultrequired
modelValue
Typestring (with onUpdateModelValue) Defaultrequired
color
TypePixelColor: active glyph fallback Default"blue"
class
Typestring Defaultnone
onUpdateModelValue
Type(value: string) => void Defaultnone
Add it to your project
One line copies DitherExpandTabs 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 DitherExpandTabs

Island

A morphing status pill: the compact row keeps its pulse while the detail unfolds beneath. Escape collapses; reduced motion snaps.

modelValue
Typeboolean (with onUpdateModelValue): expanded Defaultfalse
label
Typestring: compact row text Default"Status"
color
TypePixelColor: status dot Default"green"
live
Typeboolean: pulse the dot while collapsed Defaulttrue
class
Typestring Defaultnone
onUpdateModelValue
Type(value: boolean) => void Defaultnone
compact / children
TypeJSX.Element (children: the detail panel) Defaultnone
Add it to your project
One line copies DitherIsland 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 DitherIsland

Card stack

A swipe deck on the kit's own gesture math: 1:1 tracking, rubber-band past the edge, a flick or a far drag sends the card flying and the stack rises. Drag the top card.

items
TypeT[]: cycled forever Defaultrequired
depth
Typenumber: visible under-cards Default2
class
Typestring Defaultnone
children
Type({ item, index, top }) => JSX.Element Defaultcard face fallback
onAdvance
Type(index) after a card flies out Defaultnone
Add it to your project
One line copies DitherCardStack 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 DitherCardStack

Dock

A hover-magnifying dock: items swell on a gaussian falloff around the pointer and settle when it leaves. Reduced motion keeps the row still.

items
Type{ value, label, color? }[] Defaultrequired
magnify
Typenumber: peak scale over the pointer Default1.7
range
Typenumber (px): gaussian falloff radius Default80
class
Typestring Defaultnone
onSelect
Type(value) Defaultnone
Add it to your project
One line copies DitherDock 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 DitherDock

Preview rail

A Codex app-inspired navigation rail: compact ticks form a pyramid around the pointer and reveal a floating destination preview beside the rail. Keyboard focus previews too; reduced motion keeps the ticks still.

items
Type{ value, label, hint?, color? }[] Defaultrequired
modelValue
Typestring (with onUpdateModelValue): active destination Defaultundefined
range
Typenumber (px): pyramid falloff radius Default56
side
Type"left" | "right": edge the rail hugs Default"left"
class
Typestring Defaultnone
onUpdateModelValue
Type(value: string) => void Defaultnone
preview
Type({ item }) => JSX.Element (custom preview content) Defaultlabel + hint
Add it to your project
One line copies DitherPreviewRail 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 DitherPreviewRail

Scroll progress

Reading progress as a dithered bar. It composes DitherProgress and rides the viewport edge, or the top of any scrollable parent. Scroll the box.

attach
Type"viewport" | "parent" Default"viewport"
edge
Type"top" | "bottom" Default"top"
color
TypePixelColor Default"green"
class
Typestring Defaultnone
Add it to your project
One line copies DitherScrollProgress 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 DitherScrollProgress

Snap button

Pull to confirm: drag past the line and the border arms; release fires and the button springs home. Short pulls just spring. Enter and Space fire without the pull; reduced motion skips the spring.

threshold
Typenumber (px): displacement that arms the snap Default64
axis
Type"x" | "y" | "both" Default"x"
color
TypePixelColor: armed accent Default"green"
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
onSnap
Type() on an armed release, or Enter/Space Defaultnone
children
Typelabel content Default"Pull to confirm"
Add it to your project
One line copies DitherSnapButton 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 DitherSnapButton

Gooey menu

Actions that melt out of one trigger: an SVG goo filter fuses the circles while they travel, then they settle apart. Escape collapses; reduced motion drops the travel.

items
Type{ value, label, color? }[] Defaultrequired
modelValue
Typeboolean (with onUpdateModelValue): expanded Defaultfalse
onUpdateModelValue
Type(open: boolean) => void Defaultnone
direction
Type"up" | "down" | "left" | "right" Default"up"
spacing
Typenumber (px): gap between item centers Default52
onSelect
Type(value), also collapses Defaultnone
label
Typestring Default"Actions"
class
Typestring Defaultnone
Add it to your project
One line copies DitherGooeyMenu 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 DitherGooeyMenu

Bouncy accordion

A single-open accordion with a weighted spring layout: panels overshoot and settle on a sampled damped-spring easing, icon rows lead each header, and content rises into view. Reduced motion reveals instantly.

items
Type{ value, label, hint?, icon?, color?, content? }[] Defaultrequired
modelValue
Typestring (with onUpdateModelValue): open item, "" closes all Default""
color
TypePixelColor: icon fallback tint Default"blue"
class
Typestring Defaultnone
onUpdateModelValue
Type(value: string) => void Defaultnone
slots
TypeRecord<value, JSX.Element>: rich panel content (else item.content) Defaultnone
Add it to your project
One line copies DitherBouncyAccordion 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 DitherBouncyAccordion

Expanding arrow

An accent tile that expands into a dotted-arrow trail on hover or focus. The trail is stamped from the same accent hue. Reduced motion reveals it instantly.

color
TypePixelColor: tile and trail accent Default"blue"
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
children
Typelabel content Default"Explore the kit"
Add it to your project
One line copies DitherExpandingArrow 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 DitherExpandingArrow

Slide action

Drag the thumb to the end of the track to confirm (flick momentum counts), or release early and it springs back. Enter or Space confirms without the slide.

label
Typestring: track text and thumb aria-label Default"Slide to confirm"
color
TypePixelColor: thumb accent Default"green"
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
onConfirm
Type() when the thumb reaches the end, or Enter/Space Defaultnone
Add it to your project
One line copies DitherSlideAction 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 DitherSlideAction

Hold action

Hold to complete: a liquid fill with a dotted crest rises (or slides) while you press; release early and it drains back. A held Enter or Space works the same way.

duration
Typenumber (ms): hold time to complete Default1200
direction
Type"vertical" | "horizontal": fill axis Default"vertical"
color
TypePixelColor: fill and crest accent Default"orange"
disabled
Typeboolean Defaultfalse
class
Typestring Defaultnone
onComplete
Type() when the fill reaches full, once per hold Defaultnone
Add it to your project
One line copies DitherHoldAction 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 DitherHoldAction

Wallet card

A wallet overview card: the account switcher and search morph open from their triggers (recents listed in the panel), the balance cascades in with a change pill and privacy toggle, the address copies with feedback, the bell carries an unread pulse, and Send / Deposit / Swap / Buy report through one event.

accounts
Type{ value, label, address, balance, change?, color? }[] Defaultrequired
modelValue
Typestring (with onUpdateModelValue): selected account Defaultfirst account
balance / change
Typenumber: override the active account's numbers Defaultaccount data
currency
Typestring: balance prefix Default"$"
defaultHidden
Typeboolean: start masked Defaultfalse
searchPlaceholder
Typestring Default"Search…"
recent
Typestring[]: recent queries in the search panel Defaultundefined
notifications
Typeboolean: unread pulse on the bell Defaultfalse
color
TypePixelColor: card accent Default"green"
class
Typestring Defaultnone
onUpdateModelValue
Type(value: string) => void Defaultnone
onAction
Type("send" | "deposit" | "swap" | "buy") Defaultnone
onSearch
Type(query), live text on every keystroke Defaultnone
onSubmit
Type(query) on Enter or a recent row Defaultnone
onNotify
Type() when the bell is pressed Defaultnone
Add it to your project
One line copies DitherWalletCard 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 DitherWalletCard

Notification stack

Compact notification cards that spring from a stacked summary into a readable list on hover, focus or tap. Tap pins the list open, and the view-all row appears with the expansion. Reduced motion snaps.

Variants

items
Type{ id, title, body?, time?, icon?, color? }[] Defaultrequired
modelValue
Typeboolean (with onUpdateModelValue): pinned open; hover/focus expand transiently Defaultfalse
onUpdateModelValue
Type(expanded: boolean) => void Defaultnone
maxVisible
Typenumber: cards shown in the stack and list Default3
collapsedLabel
Typestring: header + toggle aria-label Default"Notifications"
expandedLabel
Typestring: view-all button text Default"View all"
emptyLabel
Typestring: empty-state card Default"All caught up"
variant
Type"stack" | "fan" | "condensed": collapsed silhouette Default"stack"
color
TypePixelColor: icon fallback tint Default"blue"
onViewall
Type() when view-all is pressed Defaultnone
class
Typestring Defaultnone
Add it to your project
One line copies DitherNotificationStack 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 DitherNotificationStack

Step timing

Quantized time for a quantized renderer: steps() samples progress instead of interpolating it, the temporal twin of the Bayer threshold. One keyframe run, three clocks: smooth, six-step (both endpoints visible), three-step (the end value lands only on the last frame).

The kit's shared field runtime takes the same idea down at the driver layer: frameRate paints only on wall-time boundaries and holds the raster between them: stop-motion and fewer buffer uploads. Two Auroras, same clock source, different cadence.

steps(n, position?)
Type(p) => number, css-easing-1 step positions Default"jump-end"
frameSteps(fps, durationMs)
Type(p) => number, frame(fps) cadence polyfill Defaultnone
frameIndex(elapsedMs, fps)
Typenumber: wall-clock frame gate for drivers Defaultnone
cssSteps(n, position?)
Typestring: one config serialized for CSS Default"jump-end"
DitherAurora frameRate
Typenumber (fps) Default0 (smooth)
Add it to your project
One line copies DitherAurora 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 DitherAurora

Sequences

Many animations, one clock. The timeline algebra flattens serial chains, parallel groups, staggered waves and loops into a single plan; the driver samples it and writes --seq-p + data-seq onto each child. Children style themselves, the engine only owns time. Ease with steps() and the whole wave quantizes.

Each cell reads only its own --seq-p: rise on the forward leg, sink on the yoyo leg, three cycles, settled at 1. Change the origin and the delay wave recomputes; quantize and steps(4) buckets the entire group into four positions. Reduced motion gets the settled state with zero frames.

stagger
Typenumber: seconds between neighbouring children Default0.06
from
Type"start" | "center" | "end" | "edges" | literal index Default"start"
duration / easing
Typenumber (s per cycle) / CSS timing function | linear / steps(n) from timing.ts Default0.5 / linear
loop / yoyo / delay
Typenumber / boolean / seconds before the timeline Default1 / false / 0
paused / restartOnView / frameRate
Typeboolean / boolean / fps cadence (steps a cycle, in place of easing) Defaultfalse / false / 0
restartKey / onComplete
Typestring | number (bump rebuilds and replays) / () => void Defaultnone
as
Typestring Default"div"
class
Typestring Defaultnone
children
Typecontent Defaultnone
planSequence(node | node[])
TypeSequencePlan: flatten serial | parallel | stagger | track once Defaultnone
sampleSequence(plan, t)
TypeTrackSample[]: { id, index, progress, raw, cycle, state } Defaultnone
staggerDelay(i, count, each, from)
Typenumber: the delay wave, testable alone Defaultnone
Add it to your project
One line copies DitherSequence 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 DitherSequence

Container queries

A card in a sidebar and the same card in a wide main column are not the same card, so stop asking the viewport. DitherContainer makes its own box the query target: it measures the content box (exactly what @container sees), resolves a bucket scale onto data-cq + --cq-w / --cq-i, and exposes the same state through its function child. Children restyle themselves in CSS while animations re-parameterize in JS.

The grid re-columns purely from [data-cq] (CSS reading the container's own state), while the Sequence's stagger, origin and replay derive from the same bucket through the child. Narrow it to xs and the wave tightens to 0.03s/cell; widen to xl and it fans from the center at 0.11s. quantize() rounds widths to the step so readouts and canvas painters hold like frames: the spatial half of the timing engine's step idea. This demo overrides scale so all five buckets fit the docs column; the default CONTAINER_SCALE targets wider shells. The blue bar runs the shipped dither-cq-traverse keyframe: translateX(±100cqw) makes its journey exactly one container width, so a resize re-scales the animation live, where translateX(50%) would measure the bar itself and vw would measure the viewport.

scale
TypeCqScale: Record<name, min | { min?, max? }>; min inclusive, max exclusive, order irrelevant DefaultCONTAINER_SCALE (xs 0, sm 240, md 360, lg 520, xl 720)
step
Typenumber: quantize --cq-w to this px (0 = continuous) Default0
name
Typestring: native container-name for children's @container rules Default"dither"
as / class
Typeelement tag / passthrough class Default"div" / none
children
Typefunction of { width, height, size, index, matches }: measured content box (what @container sees), active bucket, its ordinal, every matching bucket Defaultnone
resolveCq(width, scale?)
TypeCqState: the pure resolver (active = highest matching min) DefaultCONTAINER_SCALE
quantize(value, step)
Typenumber: nearest step, never negative; step ≤ 0 is identity Defaultnone
data-cq / --cq-w / --cq-h / --cq-i
Typeactive bucket attribute + content-box width/height (raw or quantized together) + ordinal, published on the host for CSS Defaultnone
dither-cq-traverse / dither-cq-rise
Typeshipped @keyframes: translateX(±100cqw) / translateY(±100cqh); motion measured against the container (small-viewport fallback when none) Defaultnone
Add it to your project
One line copies DitherContainer, DitherSequence 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 DitherContainer DitherSequence

Stage

Layers in container units. A DitherStage is a size query container with one clock (the kit's, so it seeks for video), and each DitherLayer runs keyframes whose lengths keep their units through interpolation: 10cqw to 30cqw is 20cqw halfway, mixed units become a calc(). Canvas, SVG and DOM layers move exactly relative to the stage at any size, and the same sample resolves to px through the child for anything that paints. Shrink the stage: every path shrinks with it.

The aurora is a canvas surface riding a layer: it drifts twelve percent of the stage, never twelve percent of the viewport. The two hills are SVGs on their own layers at two speeds: parallax in container units. The moon places its keys with at (seconds or a percentage) and eases one segment. The last layer keeps custom keys, cx and cy, which the child is handed resolved to px against the measured box: exactly the numbers a canvas painter needs. Nothing here is a CSS animation: the stage's clock samples every track, so a frame exported to video lands on the same moment.

duration
Typenumber (s): the stage clock loops over it; unset, time runs on Defaultnone
speed
Typenumber: clock multiplier Default1
paused / frameRate
Typeboolean / number (fps, 0 = smooth) Defaultfalse / 0
restartKey
Typeunknown: change to restart from 0 Defaultnone
as / class
Typeelement tag / passthrough class. Give the stage a height: it is a size query container Default"div" / none
children
Typefunction of { time, width, height }: the moment and the measured content box Defaultnone
data-stage / --cq-w / --cq-h
Typeplaying | directed | paused | still, and the box for CSS Defaultnone
keyframes
TypeKeyframe[]: { at? (s or '50%'), easing?, x, y (lengths: px, %, cqw, cqh, cqi, cqb, cqmin, cqmax, vw…, calc()), rotate, skewX, skewY (angles), scale, scaleX, scaleY, opacity, ...custom numbers or lengths } Default[]
duration
Typenumber (s): unset, the last key's at in seconds, else 1 Defaultnone
delay / loop / yoyo
Typenumber (s) / number | true / boolean Default0 / 1 / false
easing
Type'linear' | 'ease-out' | 'ease-in-out' | bezier points | seed | Easing: between keys; a key's own easing wins for the segment it starts Defaultlinear
origin
Typestring: transform-origin, container units welcome Default"50% 50%"
as / class
Typeelement tag / class (the layer is absolute, inset 0) Default"div" / none
children
Typefunction of every property resolved to px / degrees against the stage box, plus progress, cycle, time, width, height (the state is data-layer) Defaultnone
style / data-layer
Typetransform in the keyframes' own units, opacity, --layer-p and --layer-<name> per property; before | active | done Defaultnone
sampleKeyframes(track, t), keyframeTransform(sample, box?), resolveSample(sample, box), parseLength / termsToCss / termsToPx
Typethe engine alone, for your own painters and timelines Defaultnone
Add it to your project
One line copies DitherAurora, DitherLayer, DitherStage 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 DitherAurora DitherLayer DitherStage