|
| 1 | +--- |
| 2 | +title: Live Preview Edit Mode |
| 3 | +--- |
| 4 | + |
| 5 | +import React from 'react'; |
| 6 | +import VideoPlayer from '@site/src/components/Video/player'; |
| 7 | + |
| 8 | +**Edit Mode** turns the Live Preview interface into a full-fledged editing environment. It lets you modify elements directly in the preview. |
| 9 | +You can edit text, drag and drop elements, change images and links, inspect elements with precise measurements, and a lot more, right in the Live Preview. **Phoenix Code** automatically updates the source code. |
| 10 | + |
| 11 | +**Edit Mode** also has all the capabilities of **Highlight Mode**, such as moving your cursor in the editor when an element is clicked, and highlighting the corresponding element in Live Preview. It also works in reverse: moving your cursor in the editor highlights the corresponding element in Live Preview. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Enabling Edit Mode |
| 16 | + |
| 17 | +To switch to Edit Mode, click the **mode selector dropdown** in the Live Preview toolbar and select **Edit Mode**. |
| 18 | + |
| 19 | +<!-- TODO: add image showing the mode selector dropdown with Edit Mode selected --> |
| 20 | + |
| 21 | +Alternatively, you can switch to Edit Mode by updating the `livePreviewMode` setting in the preferences file. See [Editing Preferences](../editing-text#editing-preferences) to learn how to edit the preferences file. |
| 22 | + |
| 23 | +--- |
| 24 | + |
| 25 | +## Info Box |
| 26 | + |
| 27 | +The **Info Box** displays information about an element. It is normally shown at the top-left of the element, but if there is not enough space, Phoenix Code may display it on another side where sufficient space is available. Phoenix Code always tries to keep the Info Box visible near the element. |
| 28 | + |
| 29 | +> By default, the Info Box appears when you hover over an element in the Live Preview, but this behavior can be changed. See the **Edit Highlights on Hover** section for more details. |
| 30 | + |
| 31 | +<!-- TODO: add image showing Info Box --> |
| 32 | + |
| 33 | +The Info Box displays: |
| 34 | +- **Tag name and dimensions**: The element type (for example, `div`, `p`, `img`) and its size in pixels (width × height) |
| 35 | +- **ID**: The element’s ID attribute (if present), shown with a `#` prefix |
| 36 | +- **CSS classes**: The element’s classes, shown with a `.` prefix. If the element has more than three classes, only the first three are shown, followed by a “+N more” indicator |
| 37 | +- **Link URL**: The element’s `href` attribute (if present). This is shown only for anchor (`<a>`) elements |
| 38 | + |
| 39 | +#### Visual Indicators |
| 40 | + |
| 41 | +The Info Box normally has a *blue* background for standard HTML elements (for example, `<div>`, `<p>`, `<img>`). For dynamically created (JavaScript-rendered) elements, it appears with a *gray* background, indicating that these elements cannot be edited. |
| 42 | + |
| 43 | +<!-- TODO: add image showing the gray Info Box --> |
| 44 | + |
| 45 | +--- |
| 46 | + |
| 47 | + |
0 commit comments