# Build and preview a project

Source: https://layerwise.app/docs/build-your-app/chat-and-preview

Make changes through the project conversation, point to parts of the page, and verify the result in the local preview.

The project workspace places the conversation and local preview side by side. Use the conversation to request a focused change, then use the preview to confirm the result.

## Continue the conversation [#continue-the-conversation]

Write the next task in the conversation panel. State the desired outcome and constraints that matter. Keep related work in the same conversation; use the project sidebar to switch to another conversation when you are starting a different thread of work.

To plan before building, set a longer-running goal, or queue requests while the agent works, see [Direct the agent](./direct-the-agent).

## Test the preview [#test-the-preview]

The preview header lets you:

- Select desktop, tablet, or phone widths.
- Refresh the local preview.
- Open the preview in your default browser.
- Show or hide preview logs from **Project actions**.

![Preview header with device widths, refresh, browser opening, and Project actions marked](/docs/screenshots/preview-controls.webp)

_(1) Change the preview width, (2) refresh, (3) open in your browser, or (4) open Project actions to show the console._

Test the user path affected by the change, rather than only checking whether a screen rendered.

## Point to part of the page [#point-to-part-of-the-page]

The local preview shows a small Layerwise toolbar, in the bottom-left corner by default. Use it to show which part of the page your next message is about. Published sites do not include the toolbar.

- **Grab page element** selects one element, such as a button or heading. Use it when the change belongs to a specific element.
- **Annotate page** lets you draw on a capture of the preview. Use it for layout, spacing, or changes that span several areas.

### Select an element [#select-an-element]

1. Click **Grab page element** in the preview toolbar.
2. Move the pointer over the page. Layerwise outlines the element under it and labels its tag, text, and size.
3. Click the element. A **1 selection** chip appears above the message box.
4. Describe the change and send the message.

The selection tells the agent which element you mean, including its text, HTML, size, and main styles. For elements written in your project's code, it also includes the source file and line that render them. You can attach one element at a time; grabbing another replaces it. Press Esc to stop selecting, or use the chip's remove button to discard the selection.

### Annotate the preview [#annotate-the-preview]

Annotations are sent as images, so the selected model must support image input.

1. Scroll the preview to the area you want to mark. Only the visible part of the page is captured.
2. Click **Annotate page** in the preview toolbar.
3. Draw on the capture with the pen, highlighter, arrow, rectangle, ellipse, or text tool. You can also change the color and line width. In a narrow preview, these tools are under **More annotation tools**.
4. Click **Save**. The marked-up image is attached to your message.
5. Describe the change and send the message.

Use Command+Z or Ctrl+Z to undo, and add Shift to redo. Click **Cancel** or press Esc to discard the annotation.

### Move or hide the toolbar [#move-or-hide-the-toolbar]

Open the toolbar's menu and choose **Toolbar position** to move it to another corner or edge, or **Hide toolbar** to remove it from the page. To bring it back, open **Project actions** in the preview header and choose **Show toolbar**.

## Let the agent test its work [#let-the-agent-test-its-work]

The agent can use the local preview to check a change before it reports back. It opens pages, clicks, types, scrolls, reads the page content and console errors, and takes screenshots, then fixes what it finds and checks again. Each step appears in the conversation.

For the agent to use the preview:

- Show **Preview** rather than the **Built-in editor** in the workspace, and keep the preview loaded.
- Choose a model that supports image input if you want the agent to read screenshots. Other models check the page through its content instead.

Screenshots capture only the visible part of the preview, at the width you selected. The agent can only act on your app: external links, form submissions to other sites, and navigation away from the preview are blocked.

To ask for a specific check, describe the path to test, such as “Add a habit, mark it done, and confirm the streak goes up by one.”

## Fork an experiment [#fork-an-experiment]

Open the three-dot menu beside the conversation title and choose **Fork project** to create a separate project from the current state. A fork does not copy the GitHub connection, custom domains, or release history.

Use a fork to explore an alternative direction while preserving the original project.

## When the preview is not ready [#when-the-preview-is-not-ready]

Wait for workspace setup to finish, then refresh the preview. If it still fails, open the preview console and follow [Preview does not load](../reference/troubleshooting#preview-does-not-load).
