--- name: ui-canvas description: Preview a UI component mockup in a local browser canvas where the human directly edits it (move, resize, edit text, delete, restyle), switches mobile/desktop/custom viewports, tests it, chats with you, and clicks Save and Finish. You then turn the exported edited markup into the production component. Use before committing or rebuilding a feature just to check a visual change. metadata: origin: ECC version: "1.0.0" --- # UI Canvas Approve-before-you-build loop for user interface work: you write a quick, self-contained HTML mockup of the component, the human opens it in the browser and adjusts it by hand like a website builder, and **Save and Finish** hands you the exact result to wire into the real code. Nobody has to rebuild and rerun the whole app to check a padding change. Any component qualifies: a card, a sidebar, a modal, a settings pane, a single button state, an animation, a page section. Any harness qualifies: the loop is a CLI that prints JSON. Shares its server, state, and hooks with `plan-canvas` (inspired by [lavish-axi](https://github.com/kunchenguid/lavish-axi) by @kunchenguid). Editing conventions follow [VisBug](https://github.com/GoogleChromeLabs/ProjectVisBug) and [Onlook](https://github.com/onlook-dev/onlook): Enter/Shift+Enter walk the tree, Delete removes, an edit/interact mode switch. ## When to Use - The user asks to redesign, restyle, or add a UI component and wants to see it before you commit, rerun, or rebuild. - Feedback is visual ("make it tighter", "move that up", "lose the border") and is faster done by hand than typed. - Mobile and desktop both matter and the user wants to check the component at exact dimensions. - The user asks for `/ui-canvas`, a preview, a mockup, "show me first". Do NOT use for: plan or document review (`/plan-canvas`), running the real app, remote URLs, or components you cannot render as plain HTML/CSS/JS in one file. The canvas serves local files only. ## How It Works Invoke the CLI as `ecc-ui-canvas` (bin from the `ecc-universal` package, on PATH after a global or plugin install; `node "$CLAUDE_PLUGIN_ROOT/scripts/ui-canvas.js"` also works). It runs the same detached loopback server as `plan-canvas` (`127.0.0.1:4517`), keyed by artifact path; there are no session ids. ### 1. Write the mockup Write one self-contained `.html` file (for example `.claude/previews/.html` or next to the component): markup, a `