Changes a card from one state to the next through a wave of coloured dots that starts where the person pressed. Give it a view key; when the key changes, the old state breaks up into dots as the new one forms behind them, in 720ms. Reduced motion crossfades.
On this page
- Pay to Paid
- Run to Passed
- Publish to Live
- Join to You're in
- Any card that changes state
Examples
One row, one press
The wave starts at the button, so a small row reads as answering it. The key is all it needs: the row keeps its own layout in both states.
Installation
npx knowns-ui@latest add pixel-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 Pixel 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/pixel-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 pixel-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
- lib/knowns/motion.tsx
- lib/knowns/motion-utils.ts
- components/ui/knowns/pixel-wave/pixel-wave.tsx
- components/ui/knowns/pixel-wave/pixel-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/pixel-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: "pixel-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
- view
string- The key of the view on show. A new key plays the wave from the old view to children.
- children
ReactNode- The current view. Keep the state you want to see during the wave in it: the old copy is the same instance, frozen and inert.
- tone
"accent"|"success"|"spectrum"|[light, mid, deep]- Default
"accent" - The dots' colours: the theme accent, the paid or done greens, a warm to cool sweep, or three CSS colours or variables.
- origin
"press"|"center"|{ x, y }- Default
"press" - Where the wave starts: the last press inside (the focused control for Enter or Space), the centre, or a point in px.
- cell
number- Default
6 - Dot pitch in px, 4 to 12.
- disabled
boolean- Default
false - Swap at once, with no wave and no fade.
- onSettled
(view) => void- Called with the old key once it is gone.
| Prop | Type | Default | Description |
|---|---|---|---|
| view | string | - | The key of the view on show. A new key plays the wave from the old view to children. |
| children | ReactNode | - | The current view. Keep the state you want to see during the wave in it: the old copy is the same instance, frozen and inert. |
| tone | "accent" | "success" | "spectrum" | [light, mid, deep] | "accent" | The dots' colours: the theme accent, the paid or done greens, a warm to cool sweep, or three CSS colours or variables. |
| origin | "press" | "center" | { x, y } | "press" | Where the wave starts: the last press inside (the focused control for Enter or Space), the centre, or a point in px. |
| cell | number | 6 | Dot pitch in px, 4 to 12. |
| disabled | boolean | false | Swap at once, with no wave and no fade. |
| onSettled | (view) => void | - | Called with the old key once it is gone. |
Accessibility
- The new view is in the page at once. If focus was inside the old view, it moves to the new one: to an element marked data-autofocus, else the view itself.
- The old copy is inert and aria-hidden while it leaves, so it cannot be clicked, tabbed to or read.
- The wave is decoration on a canvas marked aria-hidden. Announce the change itself (Payment received) in your own live region.
- Reduced motion: a 120ms crossfade with no dots.
What it handles
- 01Keeps the old view on screen, as the same live instance, while the new one forms: typed fields, a spinner and scroll stay as they were.
- 02Starts the wave where the person pressed, or at the focused control when they used Enter or Space, so the change reads as the answer to that press.
- 03Breaks the old view up into a ring of dithered dots, solid at the seam and loose behind it, in a tone or three colours of your own.
- 04Makes the new view live at once: it takes focus if focus was in the old one, and the old copy is inert and hidden from screen readers.
- 05Holds the taller of the two heights for the moment, so nothing under the card jumps while it changes.
- 06Plays nothing on first render or when the key stays the same, and crossfades instead under reduced motion.
States
- First render
- Nothing. The view paints as it is
- none
- Burst
- The pressed spot turns to dots
- 120ms, ease out
- Sweep
- The ring crosses the card; old view ahead, new view behind
- 420ms, ease in-out
- Settle
- The last loose dots fade
- 180ms, ease out
- Same key
- Nothing moves
- none
- Reduced motion
- The two views crossfade, no dots
- 120ms, ease out
| State | What moves | Timing |
|---|---|---|
| First render | Nothing. The view paints as it is | none |
| Burst | The pressed spot turns to dots | 120ms, ease out |
| Sweep | The ring crosses the card; old view ahead, new view behind | 420ms, ease in-out |
| Settle | The last loose dots fade | 180ms, ease out |
| Same key | Nothing moves | none |
| Reduced motion | The two views crossfade, no dots | 120ms, ease out |
Works with
When to use
When to use
- A rare state change on a card that answers a press: Pay to Paid, Run to Passed, Publish to Live.
- Turning a form card into its result without a page change.
When not to use
- Frequent changes such as a status tick or a row refresh: they should not move: use Status Dot.
- Opening and closing a region: use Accordion.
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 Pixel Wave to my app and wire it to my own data.
- I need a rare state change on a card that answers a press: Pay to Paid, Run to Passed, Publish to Live. Set that up with the Knowns UI Pixel Wave.
- Which Pixel Wave props do I need for a minimal setup? Show me a short example.
With the server connected, your assistant calls get_component({ name: "pixel-wave" }) and search_docs({ query: "pixel wave" }).