> ## Documentation Index
> Fetch the complete documentation index at: https://wonder.design/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Code prototypes

> Turn frames into a code prototype that plays on the canvas, then play it, fix it, duplicate it and change it with an agent.

A code prototype is your design running as real code, right on the canvas. Select the frames that show a screen or its states, and your agent builds them into one interactive component: menus open, buttons respond, screens animate from one to the next. Everyone in the file sees it and can play it.

**Before you start** · Desktop app or any MCP client · Free plan

## Create a prototype

1. Select the frames to build from. Several frames are read as the states or screens of one thing, such as a menu drawn closed and open.
2. Move your pointer near the top-right corner of the selection, click the Wonder button that appears there (**Wonder actions**) and choose **Create prototype**.
3. In **Describe how it should work…**, say what should happen, such as "the plan cards switch between monthly and yearly". You can leave it empty.
4. Under **Send to**, pick the chat to send it to, or **New chat**, then click **Create prototype** or press <kbd>Enter</kbd>.

![Two frames of a plan picker, one with its plan menu drawn open, selected on the canvas, beside the Create prototype composer with a note asking for the plan menu to open from the dropdown, and Send to current chat](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/create.light.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=a0868fe12b4836a1710504855272f8bf)

![Two frames of a plan picker, one with its plan menu drawn open, selected on the canvas, beside the Create prototype composer with a note asking for the plan menu to open from the dropdown, and Send to current chat](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/create.dark.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=6c3831dd17320ff258d83cee8207d275)

You can also press <kbd>⌘</kbd><kbd>K</kbd> and run **Create prototype**, which sends the selected frames to your chat straight away, without a note.

The prototype appears beside the frames, faded under **Wondering…** while your agent writes its code, and starts playing once the code works. Your frames stay as they are. If the chat stops before the prototype has any code, the unfinished prototype is removed.

Creating a prototype needs the desktop app with Claude Code or Codex in [Wonder Chat](https://wonder.design/docs/wonder-chat.md), and edit access to the file. An agent connected over [Wonder MCP](https://wonder.design/docs/wonder-mcp.md), such as Claude Code in your terminal, can make one too: ask it to turn the frames into a code prototype. See [Prototypes](https://wonder.design/docs/wonder-mcp-tools.md#prototypes) in Wonder MCP tools.

On the Free plan, your agents can make 10 new prototypes a week. See [Check your weekly prototypes](https://wonder.design/docs/design-with-ai.md#check-your-weekly-prototypes).

## Play a prototype

Select a prototype to play it. Click and type inside it as you would in the app: it responds right where it is on the canvas. Playing works in the browser too.

Select something else, or press <kbd>Esc</kbd>, and the prototype pauses where it was. It keeps showing that screen until you select it again. Only one prototype plays at a time: the one you've selected. You can also click the play button at the right of the prototype's name to play or pause it.

While a prototype is selected, a bar at the bottom of the canvas has:

* **Navigate**: use the prototype. It's on while the prototype plays. <kbd>Esc</kbd> exits.
* **Inspect**: point at a part of the prototype to [add it to chat](#change-a-prototype-with-an-agent). Desktop app only.
* **Capture**: add an editable design of the screen it shows to the canvas, as frames and layers. Desktop app only.
* The reload button (**Reload**): start it again from the first screen.

![A selected Plan picker prototype playing on the canvas with its plan menu open and Team highlighted, a pause button beside its name, and the Navigate, Inspect, Capture and reload bar below it](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/play.light.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=f1b2e60d97c52a8fbaa6f97cfd1091b0)

![A selected Plan picker prototype playing on the canvas with its plan menu open and Team highlighted, a pause button beside its name, and the Navigate, Inspect, Capture and reload bar below it](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/play.dark.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=f7203055044d5c9e8c6aa9b476b33791)

Resize a prototype like any frame, and its layout follows the new size.

## Fix a broken prototype

When a prototype's code throws, the prototype stops and shows **This prototype hit an error**, with the error. The rest of the canvas keeps running.

![A Plan picker prototype stopped on This prototype hit an error, showing the error No plan matches the selection with the Fix with AI and Copy error buttons](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/error.light.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=351b2843453a7c69c3792dce699eae61)

![A Plan picker prototype stopped on This prototype hit an error, showing the error No plan matches the selection with the Fix with AI and Copy error buttons](https://mintcdn.com/wonder-0722b0f6/RxtLsdDuBWOSlf0j/images/code-prototypes/error.dark.webp?fit=max\&auto=format\&n=RxtLsdDuBWOSlf0j\&q=85\&s=c15cfca92817213ec94b88bd485bd5d8)

* **Fix with AI** puts the prototype in your chat and writes a message asking your agent to fix the error. Read it and send it. Your own draft in the chat is kept. **Fix with AI** needs the desktop app with Claude Code or Codex in Wonder Chat.
* **Copy error** copies the error, to paste into any agent.

If a prototype shows **This prototype stopped responding**, Wonder stopped it so the canvas keeps running. It plays again once its code changes: ask your agent to fix it.

## Duplicate a prototype

Select a prototype and press <kbd>⌘</kbd><kbd>D</kbd>, or copy and paste it, in the same file or another one. The copy plays the same code until one of them changes, then each has its own. Changing one never changes the other.

A prototype that's still being built isn't copied. Duplicating or pasting a prototype doesn't count toward the weekly prototypes on Free.

## Change a prototype with an agent

1. Select the prototype and press <kbd>⌘</kbd><kbd>L</kbd> to [add it to chat](https://wonder.design/docs/add-to-chat-from-the-canvas.md), or use **Inspect** to point at the part that's off.
2. Say what to change, such as "make the dropdown close when I pick an option".

Your agent reads the prototype's code and edits it. Everyone in the file sees the new version play as soon as it's saved. If the new code doesn't work, nothing is saved and the prototype keeps playing as it was. Changing a prototype doesn't count toward the weekly prototypes on Free.

To start a prototype over from the frames, ask your agent to rewrite it.

## Copy, export and comment

* **Copy as code**: right-click a prototype and choose **Copy as** > **Copy as code** to copy its own source. It's the only item in **Copy as** for a prototype. See [Copy and export](https://wonder.design/docs/copy-and-export.md#copy-a-layer).
* **Export code**: in the **Export** section, **Export code** saves the prototype's source as a `.tsx` file, or several prototypes as a zip. See [Export as code](https://wonder.design/docs/copy-and-export.md#export-as-code).
* **Comments**: with the Comment tool, a click in a prototype pins the comment to the element under your pointer. See [Comments](https://wonder.design/docs/comments.md#leave-a-comment).

**Copy prompt** isn't offered for a prototype. To build a design in your code, select its frames instead. See [Apply a design to your code](https://wonder.design/docs/apply-a-design-to-your-code.md).

## If something goes wrong

* **There's no Create prototype.** Select only frames, not layers inside them or a prototype. Creating a prototype also needs the desktop app with Claude Code or Codex signed in, and edit access to the file.
* **"Couldn't send to the chat".** Open a chat, or wait for its last message to send, then try again.
* **"Couldn't start the prototype. Reload Wonder and try again."** Reload Wonder, select the frames and choose **Create prototype** again.
* **The prototype disappeared while it was being built.** The chat stopped before the prototype had any code. Create it again.
* **There's no Fix with AI.** Fixing with AI needs the desktop app with Claude Code or Codex in Wonder Chat. Use **Copy error** and paste the error into your agent instead.
* **"Your agents have made 10 prototypes this week on the Free plan."** You've made this week's prototypes on Free. Your agent can still change the ones you have. See [10 prototypes a week](https://wonder.design/docs/plans-and-limits.md#10-prototypes-a-week).
* **"Couldn't copy the prototype's code".** Try copying it again.

## Related

* [Design with AI](https://wonder.design/docs/design-with-ai.md): what to ask your agent on the canvas.
* [Add to chat from the canvas](https://wonder.design/docs/add-to-chat-from-the-canvas.md): send a prototype or frames to your chat.
* [Wonder MCP tools](https://wonder.design/docs/wonder-mcp-tools.md#prototypes): the tools your agent uses to make and change prototypes.
* [Comments](https://wonder.design/docs/comments.md): leave feedback on a prototype's elements.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.