# Visual Edit





<DocVideo src="features/visual-edit/edit-on-page" alt="Selecting a heading in the Boardly preview, changing its text, padding and colour on the page, then saving the changes into app/page.tsx" width="1000" height="560" maxWidth="800" />

Visual Edit lets you click directly on elements in your app's preview and modify them — text, spacing, colors, and more — without touching the code. When you click **Save**, your changes are written to the actual source files.

<Callout type="warn">
  Visual Edit is currently available for **Next.js projects only**. Support for
  additional frameworks is planned for a future release.
</Callout>

<Cards>
  <Card title="No code required" icon="<MdOutlineCodeOff />" description="Edit text, spacing, and styles directly on the live preview, then click Save to write them to your code." />

  <Card title="AI-assisted targeting" icon="<RiRobot3Line />" description="Jump straight to the AI chat with the exact element location pre-loaded, ready for a prompt." />

  <Card title="Precise control" icon="<Crosshair />" description="Adjust margins, padding, font size, alignment, and color with dedicated inputs and a color picker." />
</Cards>

## Getting Started [#getting-started]

Click the **Visual Edit icon** in your project to activate the mode.

<DocImage src="features/visual-edit/trigger-icon" alt="The preview toolbar with the Visual Edit icon highlighted" width="2188" height="304" />

Visual Edit initializes by setting up the necessary tooling in your project. You'll see a brief loading state while this happens.

Once ready, click an element in the preview to select it and open its editing options.

## What You Can Edit [#what-you-can-edit]

### Ask AI [#ask-ai]

Sends you to the chat input with the element's exact location in the codebase already referenced. Type your change directly — no need to describe where the element is or hunt through files.

### Text Edit [#text-edit]

Lets you edit the content of HTML text elements like `<p>`, `<h1>–<h6>`, `<button>` labels, and similar tags inline. Click the field and type to update.

<Callout type="info">
  If an element's text is dynamic (rendered from a variable or prop), Visual
  Edit will indicate that the content is dynamic and won't allow direct input.
  Use **Ask AI** in that case to make the change through the agent.
</Callout>

### Margin & Padding [#margin--padding]

Provides pixel-level inputs for horizontal (X) and vertical (Y) margin and padding on the selected element. Adjust each axis independently for precise layout control.

### Text Styling [#text-styling]

Controls for the selected element's typography and color:

* **Alignment** — left, center, right, justify
* **Font size** — set in pixels
* **Color** — dedicated color palette for quick picks, plus a full color picker for exact values

### Delete [#delete]

Removes the selected element from the component entirely. Like other edits, it stays pending until you click **Save**.

## Shared Components [#shared-components]

If you select and edit an element that belongs to a shared or reusable component — such as a common text renderer, button, or card — the change will reflect **everywhere that component is used** across the project. This is expected behavior, but worth keeping in mind if you intend to change only one instance.

To edit a single instance without affecting others, use **Ask AI** and ask the agent to extract that instance into its own component first.

### FAQ [#faq]

<Accordions>
  <Accordion title="Why can't I edit text on some elements?">
    If the text content is driven by a variable, prop, or data fetch, Visual
    Edit marks it as dynamic and disables direct input. Use the **Ask AI**
    option to instruct the agent to update the source value instead.
  </Accordion>

  <Accordion title="Visual Edit is stuck or not loading on my Next.js project — what should I do?">
    Check your `next.config.ts` for a Turbopack configuration and remove it if
    present. Visual Edit relies on a custom webpack loader that is incompatible
    with Turbopack. The project must run with webpack, and the following loader
    must be present in your config:

    ```ts
    // Loader path from @ideavo/webpack-tagger - use direct resolve to get the actual file
    const loaderPath = require.resolve('@ideavo/webpack-tagger');
    ```

    If this entry is missing, Visual Edit won't be able to tag elements for
    targeting and will appear stuck on the loading screen.
  </Accordion>

  <Accordion title="Will editing a shared component affect all pages?">
    Yes. If the element belongs to a component used in multiple places, your
    edit will propagate everywhere that component renders. To scope the change
    to a single instance, ask the AI to extract it into a separate component
    first.
  </Accordion>

  <Accordion title="Do Visual Edit changes count against my AI credits?">
    Direct edits — text, spacing, styling, and deletes — do not consume AI
    credits. Using **Ask AI** from the tooltip opens the chat and any prompt
    you send from there uses credits as normal.
  </Accordion>
</Accordions>
