Skip to content

Dither Wave

A band of ordered-dither cells whose edge is a soft wave that drifts slowly, fading from solid colour to sparse dots. It rises from the bottom of a hero or hangs from the top, and a pointer passing over it leaves a small ripple in the cells. Its dots clear under your copy, so it works as a hero's background. In the Site Footer wave variant it is the footer's top edge, rising out of the footer's colour into the page.

On this page

Examples

Density
Speed
Mask
Focus
Colour
Direction
Amplitude
Cell

Installation

npx knowns-ui@latest add dither-wave
For Claude Code, Cursor or Codex: installs it and wires the props to your own data.

Props

children
ReactNode
Content drawn above the background. The root is relative and isolated; size it with className.
density
"low" | "medium" | "high" | number
Default"medium"
How much is drawn. A number is a multiplier from 0.25 to 3.
speed
number
Default1
Motion multiplier, up to 4. 0 holds a still frame.
color
string
Default"primary"
A theme token ("primary", "muted-foreground", "ring", "chart-1"…), a CSS variable ("--brand") or any CSS colour.
mask
"radial" | "top" | "bottom" | "edges" | "none"
Default"none"
Where it stays visible; it fades out elsewhere.
focus
"center" | "band" | "none"
Default"none"
A quiet zone behind your content: the pattern fades out there so body copy stays at AA contrast. Stacks with mask. The demos use "center".
intensity
number
Default1
Overall strength, 0 to 1.5.
paused
boolean
Defaultfalse
Stops the motion. It also stops offscreen, in hidden tabs and with prefers-reduced-motion (a still, composed frame).
className / style
-
On the root.
direction
"rise" | "hang"
Default"rise"
Rise: the band sits at the bottom and its edge is on top. Hang: it hangs from the top.
level
number
Default0.5
Where the edge rests, as a fraction of the height from the band's side.
amplitude
number
Default0.16
How far the edge swings, 0 to 0.45 of the height.
fade
number
Default0.45
How deep the fade from sparse dots to solid colour is, as a fraction of the height.
cell
number
Default4
Cell size in px, 2 to 10. Density nudges it.
ripple
boolean
Defaulttrue
A pointer passing over the band leaves a small ripple: a ring that lifts the cells it crosses and fades in 600ms. Off under reduced motion.
matrix
4 | 8
Default8
Bayer matrix size. 4 is coarser and more patterned.
seed
number
Default0
Phase offset, so two waves on one page do not move in step.
clearTop
number
Default0
A clean strip along the top edge in px, fading back in over 32px. Use the header's height (64) when a bar sits over the field, so it is always on a clean area whatever the level and amplitude.
peak
number
Default1
The most light a cell can take, 0.2 to 1. Below 1 the solid part becomes a dense field of dots.
grain
number
Default0
Noise, 0 to 1. Scatters the sparse dots, sprays a few past the edge and roughens the edge column by column. Fixed per cell, so it never flickers.
clear
boolean | { x, y, w, h }
Defaulttrue
Keeps the solid band off your text: a soft hole under each line of text and each control, so the dots thin out around the copy. It measures the children, or the content beside it when used as a hero's or footer's background. A fixed box in fractions of the field, or false for none.
Motion
-
Canvas. The edge is three sine layers drifting at different speeds, so it never repeats in a way the eye follows. It draws only while on screen and only while something moves; with speed 0 a ripple wakes it until the ripple is over. Reduced motion: one still frame, no ripple.

When to use

When to use

  • The bottom of a hero or a closing section: a band of dots with a slow wave edge, in the accent colour.
  • A header or footer that needs one quiet moving edge: the site header and footer have a wave variant built on it.

When not to use

  • Behind body copy: the solid part of the band is full colour, so keep text above the edge.
  • A still dot texture behind a hero: use Dither Field.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Dither Wave to my app and wire it to my own data.
  • I need the bottom of a hero or a closing section: a band of dots with a slow wave edge, in the accent colour. Set that up with the Knowns UI Dither Wave.
  • Which Dither Wave props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "dither-wave" }) and search_docs({ query: "dither wave" }).

Need help?

Stuck on Dither Wave, or found something off? We read every message.