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
Installation
npx knowns-ui@latest add dither-wavePaste this into your coding agent (Claude Code, Cursor, Codex). It checks your project, sets up the registry, runs the install and verifies it.
Install Dither Wave from Knowns UI into this project. Work step by step, show me each change, and ask before you edit files outside this project.
Context: Knowns UI (https://ui.knowns.dev) is a shadcn registry. Items land in the project as source files. Docs: https://ui.knowns.dev/docs/dither-wave
1. Check the project first. Stop and tell me if any of these is missing:
- React 19 and Tailwind CSS v4.
- A components.json at the project root. If there is none, ask me before running `npx knowns-ui@latest init --no-key` (it runs shadcn init when needed, then adds the registries).
2. Run:
```bash
npx knowns-ui@latest add dither-wave
```
It writes these files:
- lib/knowns/run.ts
- lib/knowns/json.tsx
- lib/knowns/status.ts
- lib/knowns/tone.ts
- lib/knowns/types.ts
- lib/knowns/use-abortable.ts
- lib/knowns/utils.ts
- components/ui/knowns/illustrations/illust-utils.ts
- components/ui/knowns/illustrations/use-in-view.ts
- components/ui/knowns/blocks/backgrounds/background-frame.tsx
- components/ui/knowns/blocks/backgrounds/bg-canvas.ts
- components/ui/knowns/blocks/backgrounds/bg-utils.ts
- components/ui/knowns/blocks/backgrounds/field-canvas.ts
- components/ui/knowns/blocks/backgrounds/field-utils.ts
- components/ui/knowns/blocks/backgrounds/dither-field.tsx
- components/ui/knowns/blocks/backgrounds/dither-field-utils.ts
- components/ui/knowns/blocks/backgrounds/dither-wave.tsx
- components/ui/knowns/blocks/backgrounds/dither-wave-utils.ts
and installs these npm packages: clsx@^2.1.1, tailwind-merge@^3.7.0.
3. While it runs:
- It also adds a few @keyframes (all named kn-*) to the global CSS file (globals.css or the file components.json points at). Let it: they only add animations.
- If it asks to overwrite files under lib/knowns/: these are shared by every Knowns UI item. List them, say whether I changed them (check git), and ask me before you answer.
- If it asks to overwrite any other file, show me the diff and ask me.
4. Verify:
- Every file in the list above exists.
- The project type-checks (for example `npx tsc --noEmit`) and the dev build has no new errors.
5. Use it: follow the examples and props on https://ui.knowns.dev/docs/dither-wave, and ask me if anything about my data is unclear.
If the Knowns UI MCP server is connected (https://ui.knowns.dev/docs/ai-and-mcp), use get_component({ name: "dither-wave" }) or search_docs for details.
Finish with a short summary: the files you added or changed, the packages you installed, and anything I still need to do.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- Default
1 - 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- Default
1 - Overall strength, 0 to 1.5.
- paused
boolean- Default
false - 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- Default
0.5 - Where the edge rests, as a fraction of the height from the band's side.
- amplitude
number- Default
0.16 - How far the edge swings, 0 to 0.45 of the height.
- fade
number- Default
0.45 - How deep the fade from sparse dots to solid colour is, as a fraction of the height.
- cell
number- Default
4 - Cell size in px, 2 to 10. Density nudges it.
- ripple
boolean- Default
true - 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- Default
8 - Bayer matrix size. 4 is coarser and more patterned.
- seed
number- Default
0 - Phase offset, so two waves on one page do not move in step.
- clearTop
number- Default
0 - 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- Default
1 - The most light a cell can take, 0.2 to 1. Below 1 the solid part becomes a dense field of dots.
- grain
number- Default
0 - 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 }- Default
true - 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | - | Content drawn above the background. The root is relative and isolated; size it with className. |
| density | "low" | "medium" | "high" | number | "medium" | How much is drawn. A number is a multiplier from 0.25 to 3. |
| speed | number | 1 | Motion multiplier, up to 4. 0 holds a still frame. |
| color | string | "primary" | A theme token ("primary", "muted-foreground", "ring", "chart-1"…), a CSS variable ("--brand") or any CSS colour. |
| mask | "radial" | "top" | "bottom" | "edges" | "none" | "none" | Where it stays visible; it fades out elsewhere. |
| focus | "center" | "band" | "none" | "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 | 1 | Overall strength, 0 to 1.5. |
| paused | boolean | false | 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" | "rise" | Rise: the band sits at the bottom and its edge is on top. Hang: it hangs from the top. |
| level | number | 0.5 | Where the edge rests, as a fraction of the height from the band's side. |
| amplitude | number | 0.16 | How far the edge swings, 0 to 0.45 of the height. |
| fade | number | 0.45 | How deep the fade from sparse dots to solid colour is, as a fraction of the height. |
| cell | number | 4 | Cell size in px, 2 to 10. Density nudges it. |
| ripple | boolean | true | 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 | 8 | Bayer matrix size. 4 is coarser and more patterned. |
| seed | number | 0 | Phase offset, so two waves on one page do not move in step. |
| clearTop | number | 0 | 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 | 1 | The most light a cell can take, 0.2 to 1. Below 1 the solid part becomes a dense field of dots. |
| grain | number | 0 | 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 } | true | 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" }).