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

# Visual editing in Devin previews

> Edit a page in Devin's browser preview directly: change styles and text, draw on the page, and send the exact changes to Devin to apply in your code.

Visual editing lets you show Devin what to change on your running app instead of describing it. Open the app in the session's **Preview** tab, click the select button, and point at what you want changed: an element, an area, or a mark you draw on the page. You can also change the element's styles and text yourself and see the result on the page right away. Devin gets each change with the context it needs and makes it in your code.

UI feedback is spatial and hard to put into words, like "a bit more padding", "this blue, but darker" or "line these up". Pointing at the element, or making the change yourself, tells Devin exactly what you mean.

<video src="https://mintcdn.com/cognitionai/-slPyGvQBX1asH-O/images/visual-editing/select-light.mp4?fit=max&auto=format&n=-slPyGvQBX1asH-O&q=85&s=28954a2db911e23fca64188f911e67c6" poster="/images/visual-editing/select-light.jpg" autoPlay muted loop playsInline controls aria-label="Turning on element selection in a Preview of the Devin homepage, hovering over the headline and navigation, then selecting the Get started button and typing the note Make this button brand blue" />

## Open visual editing

Visual editing works on any app open in a [browser preview](https://docs.devin.ai/work-with-devin/browser-previews.md#opening-a-preview). Click the select button (the cursor icon) in the Preview toolbar, or press . The button reads **Selecting** while it's on.

To stop, click **Selecting** again or press <kbd>Esc</kbd>. If you are editing text on the page, <kbd>Esc</kbd> first cancels the text edit.

## Ways to direct Devin

Each change starts with something you pick on the page. A menu opens next to it with a **Describe a change…** box for your note.

### Select an element

Hover over the page to see each element's outline, then click the one you want to change. Type what you want in **Describe a change…** and press <kbd>Enter</kbd> to add it to your message.

### Mark an area

Drag across the page to box in an area, such as a section that needs more room, then describe the change. Devin gets the area and every element inside it.

<video src="https://mintcdn.com/cognitionai/-slPyGvQBX1asH-O/images/visual-editing/box-light.mp4?fit=max&auto=format&n=-slPyGvQBX1asH-O&q=85&s=4be99a17d05dbe644c974fd1e1eba60a" poster="/images/visual-editing/box-light.jpg" autoPlay muted loop playsInline controls aria-label="Drawing a box around the Devin homepage hero, then typing the note Give the hero more room" />

### Draw on the page

Use the tools at the bottom of the Preview to mark up the page:

* **Draw a box** around something.
* **Draw with pencil** to circle, underline or sketch. Pick a pencil color to tell several marks apart.
* **Clear annotations** removes your drawings, and **Select element** goes back to picking elements.

Devin gets a screenshot with your drawing on it.

### Edit properties

Open **Edit properties** in an element's menu to change its styles. The panel starts from the values the page is rendering now, grouped by what they control. Type in **Search or caption…** at the top of the menu to jump to a property by name.

| What you can change | Examples |
| - | - |
| Layout | Flex direction, wrap, alignment, gap, grid columns |
| Size | Width and height as fit content, fill parent or a fixed size, plus min and max |
| Spacing | Padding and margin, all sides or one side at a time |
| Typography | Font family, size, weight, line height, letter spacing, alignment, case, decoration |
| Color | Text, background and SVG color |
| Border and corners | Border width, style and color per side, corner radius |
| Effects | Box shadows, opacity, object fit |

<video src="https://mintcdn.com/cognitionai/-slPyGvQBX1asH-O/images/visual-editing/properties-light.mp4?fit=max&auto=format&n=-slPyGvQBX1asH-O&q=85&s=570a3b097a7ca791b791a22f6254a674" poster="/images/visual-editing/properties-light.jpg" autoPlay muted loop playsInline controls aria-label="Opening Edit properties on the homepage's Get started button, picking a green from Document colors for its background, then searching CSS variables and applying --color-accent, with the button updating on the page each time" />

A few controls keep your edits consistent with the rest of the page:

* **Drag to adjust.** Drag across a number field to change it in steps. One drag is one undo step.
* **Document colors and shadows.** The color picker lists colors already used on the page, and the shadow editor offers the page's existing shadows.
* **CSS variables.** Pick one of the page's CSS variables instead of a raw value, so Devin can reuse the same token.
* **Pick color from page.** Use the eyedropper to sample any color on screen.

Click the reset icon next to a property to return it to its original value, or use **Reset element** to undo every change on the element.

### Edit text

On a text element, choose **Edit text** and type directly on the page. Press <kbd>Esc</kbd> to cancel.

### Delete an element

**Delete element** removes the element from the page so you can see the layout without it. Undo it from the notice that appears.

### Undo and redo

**Undo** and **Redo** step through all your edits in the Preview, across elements.

## Send changes to Devin

Click **Add to chat** in the element's menu, or press <kbd>Enter</kbd> in **Describe a change…**. The element goes into your message as a quote with its changes and your note, and you can keep picking other elements. Each element becomes its own quote, so one message can carry changes to several elements.

Before you send, open a quote to see its changes, edit its note or remove it. The select button shows how many changes you haven't added to the chat yet.

<video src="https://mintcdn.com/cognitionai/-slPyGvQBX1asH-O/images/visual-editing/quote-light.mp4?fit=max&auto=format&n=-slPyGvQBX1asH-O&q=85&s=14353044750a19137468047b2c1abace" poster="/images/visual-editing/quote-light.jpg" autoPlay muted loop playsInline controls aria-label="Clicking Add to chat on the Get started button, which adds it to the chat box as a quote with its note" />

Send the message as usual. Devin makes the changes in your code, and you see the real result in the Preview once the app reloads.

## Keyboard shortcuts

| Action | Shortcut |
| - | - |
| Turn element selection on or off | |
| Mark an area | Drag across the page |
| Add the element and note to your message | <kbd>Enter</kbd> |
| Undo an edit | |
| Redo an edit | |
| Step a number field by 1, 10 or 0.1 | <kbd>↑</kbd> / <kbd>↓</kbd>, with <kbd>Shift</kbd> or  |
| Cancel a text edit, or stop selecting | <kbd>Esc</kbd> |

## What Devin sees

Your edits change only the page open in your Preview, not your source code. Nothing on Devin's machine changes until you send them. Each quote gives Devin:

* **The element.** Its tag, id and classes (for example `<button id="submit" class="primary">`), up to 120 characters of its visible text, and the page URL. In React development builds, it also includes the component name and, before React 19, the source file and line. For an area, Devin gets the area's size and every element inside it.
* **What changed.** Every property you edited, with its old and new value, such as `padding: 8px → 16px`. Text edits come through the same way.
* **A screenshot** of the element as you left it, or of the area with your drawing on it.
* **Your note**, if you wrote one.

Everything in a quote is shown in its menu and quote card, so you can read exactly what Devin will get before you send it.

The edits show Devin the result you want; Devin decides how to get there in your codebase, for example by changing a design token, a Tailwind class or a shared component instead of hard-coding a value.

## Work in flow

One edit usually leads to the next: you adjust a component, notice the spacing around it, then see how another part should match. Keep going while Devin works. Pick the next element and send another message; Devin takes it as a follow-up. If your dev server hot reloads, changes appear in the Preview as Devin makes them.

* **Edit, then explain.** Make the change visually and add a short note about intent, for example "match the card padding on the pricing page" or "do this for every primary button". Devin applies the edit where you made it unless your note says otherwise.
* **Group related changes.** Edit all the elements in one section before you send, so Devin can make one consistent change instead of several small ones.
* **Prefer page values.** Choosing document colors and CSS variables keeps Devin on your existing design tokens.
* **Point for layout feedback.** A box around an area plus a sentence is often clearer than editing many properties.

## Limitations

* Edits apply to the page as it is now. Navigating to another page or reloading the Preview discards edits you have not added to the chat.
* Devin decides how to apply the change in your codebase. Check the result in the Preview, and send a follow-up if it needs adjusting.
* A message can hold only so many quotes. If one won't fit, send the message and add the rest to the next one. Very long text edits are also sent without their structured details.

## Related

* [Browser previews](https://docs.devin.ai/work-with-devin/browser-previews.md): how previews work, who can open them and how to share them.
* [Testing and recordings](https://docs.devin.ai/work-with-devin/testing-and-recordings.md): have Devin test the app and record it.


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