# Canvas

Select, edit, move and zoom the elements of your running app, and every change is written to your code.

Use the canvas to select, edit and move the elements of your app, and every change is saved to your code. It is the center of the editor in **Design** mode, and each frame on it is your real app, served live from its cloud sandbox.

The editor in Design mode with a frame on the canvas, an element selected and its floating toolbar.

## What you can do

- Select any element in a frame and edit it, even one under another layer.
- Edit text in place.
- Move elements by dragging them.
- Copy, paste, duplicate, wrap and delete elements.
- See how each side of the selection sizes, and drag its padding and gaps.
- Copy the style of one element and paste it onto others.
- Bring an element to the front or send it to the back, and flip it.
- Ask the AI about the selected element.
- Pan and zoom across several frames.
- Undo and redo your changes.

## The canvas tools

The floating bar at the bottom of the canvas holds the tools. It is hidden in **Code** mode.

| Control                         | What it does                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Select** (`V`)                | Select and edit elements.                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| **Pan** (`H`)                   | Drag to move around the canvas.                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| **Annotate** (`M`)              | Point at an element or draw an area, write a note, then send your notes to the AI. See [Annotate](/features/collaborate/annotate).                                                                                                                                                                                                                                                                                                                                                                 |
| **Move axes** (`W`)             | Show arrows on the selected element: drag an arrow or the center to move it along X, Y or Z.                                                                                                                                                                                                                                                                                                                                                                                                       |
| **Zoom In** / **Zoom Out**      | Change the zoom, up to 800%. Open the zoom menu to type a level, for **Zoom Fit**, **Zoom to Selection**, **Zoom 50%**, **Zoom 100%**, **Zoom 200%** and **Re-Center Canvas**, for **Go to**, which lists the pages and sections of the canvas, and for the view toggles: **Wireframe View** shows every page as its layout, **Pixel Grid** draws a line between every pixel from 400%, **Rulers**, **Guides**, **Layout Grid**, **Minimap**, and **Hide Interface**, which keeps only the canvas. |
| **Move to your plan's machine** | Shows when your project runs on a smaller machine than your plan gives. Your files are saved, then the project restarts on that machine.                                                                                                                                                                                                                                                                                                                                                           |
| **Restart sandbox**             | Restart the cloud sandbox when the preview stops responding.                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| **DevTools**                    | Open the [DevTools](/features/test-and-debug/devtools).                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| **Panel** (`Cmd/Ctrl + J`)      | Open the bottom panel with Problems, Output, Browser console and Terminal.                                                                                                                                                                                                                                                                                                                                                                                                                         |

## Select and edit an element

1. ### Select it

   Click an element in a frame. A blue outline and a floating toolbar appear. Hold `Shift` and click to add more elements to the selection. You can also select an element from the [Layers](/features/design/layers) panel. To reach a layer under another one, see [What a click selects](#what-a-click-selects).

   Move through the page with the keyboard: `Enter` selects what the selected element holds (on a text, it edits the text), `Shift + Enter` selects the element around it, up to the whole frame, and `Tab` or `Shift + Tab` selects the next or previous element at the same level.
2. ### Change it

   Use the floating toolbar for the most common changes:

   - **Text style**: preset text styles, size and weight.
   - **Color**: **Text**, **Fill** and **Border** colors.
   - **Alignment**: text alignment, and the direction, alignment and gap of the children.
   - **Spacing**: padding and margin.
   - **Corners**: the corner radius.
   - **Link**: the link of a link element.
   - **Properties**: opens the [Properties](/features/design/properties-panel) view, for a field's type, a link's tab, a video's playback or a component's settings.
   - **More**: **Ask AI about this element**, **View in code panel**, **Open Styles**, **Duplicate**, **Wrap**, **Unwrap**, **Section ID…** and **Delete**. On a form you saved, **Edit form** opens it in the form builder.

   For every other property, choose **Open Styles** or open the [Styles](/features/design/styles) panel.
3. ### Edit text

   Double click a text element, or select it and press `Enter`. Type, then click outside to finish. When the words are written somewhere else in your code, such as a translation file, Lyna writes them there. See [Text written elsewhere in your code](#text-written-elsewhere-in-your-code).

A selected heading with the floating element toolbar and the Text style menu open.

## Text written elsewhere in your code

When the words of a text are not written in the element itself, Lyna edits them where they live:

- **A translation**: in an app that shows its words in several languages, the edit changes the language the frame shows, in that language's file.
- **An item of a list**: the words of this item in the list's data. The other items keep theirs.
- **A setting of a component**: that setting on this use of the component, such as the title of one card.

While you type, a note under the text says where the words are written (**Where these words are written**), with the file and line and a button that opens it.

When the same words show several times, such as the title of every card of a list, the note says **Changes all N copies**. **Just this one: ask Lyna** puts a request in the chat to give this copy words of its own.

### Translated text

Lyna follows your app's own translation files. While you edit a translated text:

- The note reads **Translation**, the text's key and the language shown, with **Only English** (or the language the frame shows): only that language changes.
- When you edit the source language, the one your app falls back to, the other languages are marked **Needs review** and keep their words for you to check. The note says how many languages will need review. An edit in another language clears its own mark. Lyna keeps these marks in its own folder of your project, never in your translation files.
- **Edit all languages** opens a table of the text in every language, the source first, each with its state: **Source**, **Needs review**, or **Missing in** a language that has no words for it yet. Change the ones you want and choose **Apply**: Lyna writes only the languages you changed, in one step you can undo.
- **Translate the others** asks Lyna AI, in the chat, to fill the languages that are missing or need review. Nothing is translated without it.
- An AI translation spends credits per batch of 40 texts, so Lyna shows the price on its card first, and **Leave them as they are** spends nothing. Each translation keeps the placeholders, plural forms and links of its source, or it is left untranslated, and the texts Lyna AI wrote read **AI translated** until you check them.
- A text with a placeholder, such as a name or a count, opens the table at once. A language whose words drop a placeholder names the one to keep, and **Apply** stays off until you put it back.
- When the same translation shows in several places, the note says **Changes all N places**. Choose **Just this one** to give this element a text of its own, copied into every language.

A translated heading being edited on the canvas, with the note under it: Where these words are written, Translation, its key and English, Only English, Edit all languages and the file name.

The Edit all languages table next to a heading, with the English source words and the French words marked Needs review, and the Apply button.

### Show the page in another language

A new project keeps every word of its pages in one language file, ready for more languages. In a site that speaks several languages, select a frame and open the **Canvas language** menu (the globe) in the frame toolbar:

- Pick a language: every frame shows the site in it, with no reload, and each page keeps its address in that language. Each language shows the share of its texts already translated; the language visitors meet first reads **Default**.
- **Show untranslated** marks the words the page still shows in the default language because the chosen one lacks them.
- **Pseudo-language** shows every translated word accented and between brackets, so a word left out of the translation stands out as plain text.
- **Open Translations** opens the Translations pane, where you manage the languages.

On a phone, open **Design** and choose the globe in its header: the sheet shows the same choices in place of its tab. In the command palette (`Cmd/Ctrl + K`), type the language's name or "language" to find **Show the canvas in** each language, **Show untranslated**, **Pseudo-language** and **Open Translations**.

Your choice stays in the editor: visitors and shared previews still open the site in their own language.

### Words Lyna can't write here

Some words have no place to type into: words mixed with values your code works out, words your app loads while it runs, or a text drawn inside a component from a library. Lyna does not refuse in silence. It opens **These words come from your code**, or **These words can't be edited here** for a library's part, which says where the words come from, with the file and line, and offers **Show in code** and **Ask Lyna**. For a library's part, it also offers to select the element around it that is in your code.

## What a click selects

A click selects what you see under the pointer, and the outline that shows when you hover is always what a click selects. This holds even where the page itself keeps the pointer away from an element:

- **Text past its box**: a click on letters that run outside their box, like a large number in a narrow column, selects that text, not the box beside it.
- **A transparent box**: when an empty box lies over other content, a click selects what shows through it. Inside a box that has a color or a picture of its own, a click still selects the box.
- **A background behind the content**: a video, a picture or a gradient that fills a section behind its content never takes a click from the text or the picture you see with it, even where the page draws it on top. Click an empty part of the section to select the background.
- **An open dialog**: the page behind its dimming layer is out of reach until you close it, or lock that layer.
- **An open menu or drawer**: a click beside its panel stays in the menu, on the full-screen layer that holds it, never on the page it covers.
- **Content the page makes unclickable**: a section behind an open menu, or a layer the page lets clicks pass through, is selected like anything else. A decoration that shows nothing at that point, like a grain or a fade, stays out of the way.

### Reach a layer under another

- **Alt-click** (`Option`-click on a Mac) selects the next layer under the pointer. Alt-click again at the same spot to keep going: after the last layer, it starts again from the first. Locked layers are skipped. A plain click, or an Alt-click somewhere else, starts over.
- **Right-click**, then **Select Layer**, lists every layer under the point, from the outermost to the innermost. A check marks the current selection and a padlock a locked layer. When you move over a row, with the pointer or the arrow keys, its layer is outlined on the canvas. Choose a row to select its layer.

The right-click menu open on a heading with the Select Layer submenu listing the layers under the pointer, the second row highlighted and its layer outlined on the canvas.

## Size and spacing on the canvas

Under the selected element, a badge shows its width and height and how each side sizes:

| Word      | What it means                                 |
| --------- | --------------------------------------------- |
| **Hug**   | The side fits its content.                    |
| **Fill**  | The side fills the space its parent gives it. |
| **Fixed** | The side has a set size.                      |

The selected element also shows its padding on each side and the gaps between its children. Drag a padding band to change that side, or a gap band to change the gap. Hold `Alt` to change all four sides at once, and `Shift` to move in steps of 4 px. When the space between the children does not come from the gap (it spreads the free room, or each child has a margin), its chip says where it comes from, and a press on it offers **Convert to gap**.

A selected container with its padding marked on each side and the size badge 960 Fill by 416 Fill under it.

When the text of the selected element runs past its box, a dashed outline shows how far the text reaches. The **Typography** section of the [Styles](/features/design/styles) panel then says **Text overflows its box by N px** and offers **Hug width**, which sets the text to **Auto width** so that its box fits its words.

A selected heading whose text runs past its box, with a dashed outline around the text, next to the Typography section that says by how many pixels the text overflows its box, with the Hug width button.

Hover a box that lays out its content in a row, a column or a grid to see how: each item gets a dashed outline and each gap between items a striped tint, before you click.

## Move elements

Drag a selected element to a new place. A drop line shows where it will land. If the drop is not allowed, the line turns red and tells you why, for example **Can't drop into own descendant**.

You can also move the selected element up or down among its siblings with `Shift + Arrow Up` and `Shift + Arrow Down`.

Hold `Alt` to see the distances between the selected element and the element under the pointer.

A resize, a padding drag or a move keeps following its element, even when your page draws that element again in the middle of the gesture, for example after a live update of your code.

### Animations while you edit

When **Play animations** is on in the [frame toolbar](/features/design/frames-and-devices#the-frame-toolbar), starting a resize, a padding drag, a move or a text edit pauses the animations and shows each element at rest, so you never edit a moving box. The animations stay paused after the gesture: choose **Resume animations** in the frame toolbar to play them again.

## When an edit can't be applied

Sometimes Lyna can't apply an edit the way you asked: the value comes from your code, from the layout around the element, or from a part Lyna doesn't write. Lyna never ignores the edit in silence. A small panel opens next to the element, or next to the handle you let go of, and says:

- why the edit can't be applied, in plain words;
- who sets the value, and where: the file and the line in your code;
- the ways forward, always in the same order: the setting that does move it, the parent, writing a value here, the code, then Lyna.

| Situation                                                                                                                  | Ways forward                                                                                                                     |
| -------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| A size set in code, such as a section that scrolls sideways, a value your code works out or a style written on the element | The component's own controls, **Override with a fixed height**, **Show in code**, **Ask Lyna**                                   |
| A size the layout holds: a minimum or a maximum, a parent that stretches it, or no room left                               | **Select the parent**, **Align this item to Start**, **Switch to a fixed width**, **Widen its box**                              |
| A padding or margin drag that stops short                                                                                  | **Set width to Hug**, **Remove the auto margins**                                                                                |
| A picture or a link address that comes from your code, such as an item of a list or a setting of a component               | **Change it for this item only**, **Change it on this use only**, **Use this picture for all N**, **Show in code**, **Ask Lyna** |
| An element drawn by a library, or added while the page runs                                                                | Select the element around it that is in your code, open it in code, **Ask Lyna**                                                 |
| A list item whose order your code works out                                                                                | **Open the list in code**, **Ask Lyna to move it**                                                                               |
| A drag that starts on a locked layer                                                                                       | **Unlock**, **Select**                                                                                                           |
| An undo that can't run                                                                                                     | **Stop Lyna**, **Wake the project**, **Undo again**, **Open History**                                                            |

The [Styles](/features/design/styles#where-a-value-comes-from) and [Properties](/features/design/properties-panel#values-set-in-your-code) panels show the same panel from a badge beside the value. Each choice that writes is one step you can undo. **Ask Lyna** puts a precise request in the chat for you to send; it never sends it for you. Press `Esc` or click outside to close the panel.

The panel This picture comes from your code next to a card's picture, with the cause, the file and line, and Change it for this item only, Show in code and Ask Lyna.

### When the file changed while you edit

Lyna AI, a save in the code panel or another tab can change a file while you edit it. Your edit never overwrites that newer change. When your edit touches other lines, Lyna adds it to the new text and both changes stay. When it touches the very lines that changed, nothing is written and a message says **Your change to Hero.tsx was not saved**, with **Show in code** and **Ask Lyna**, and **Try again** when Lyna can make the same change again on the file as it is now. Undo and redo follow the same rule: they take back only your own step and keep the newer change, and when the lines they put back changed, the message says **Undo did not run** or **Redo did not run**.

## The right-click menu

Right-click an element to open its menu. An entry with a submenu is listed with what it holds:

| Part of the menu  | Entries                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Clipboard         | **Cut**, **Copy**, **Paste**, **Duplicate**, **Copy/Paste As** (**Paste Here**, **Paste to Replace**, **Copy As** with **Code**, **SVG** or **PNG**, **Copy Style**, **Paste Style**), **Copy link to selection**                                                                                                                                                                                                                                   |
| Layers and layout | **Select Layer**, **Order** (**Bring to Front**, **Bring Forward**, **Send Backward**, **Send to Back**), **Layout** (**Wrap**, **Unwrap**, **Add Layout**, **Remove Layout**), **Flip** (**Flip Horizontal**, **Flip Vertical**), **Use as mask** or **Release mask**                                                                                                                                                                              |
| State             | **Hide** or **Show**, **Lock** or **Unlock**, **Rename**                                                                                                                                                                                                                                                                                                                                                                                            |
| Edit              | **Edit text**, **Remove picture** on a picture, **Add motion**, **Create component**, **AI** (**Ask AI about this element**, **Add to AI Chat**, **New AI Chat**), **More** (**View instance code**, **View in code panel**, **Open Styles**, **Properties**, **Save as block**, **Set as thumbnail**, **Section ID…**, **Select Matching**, **Hide and Collapse** or **Show and Expand**, **Disable Text Selection** or **Enable Text Selection**) |
| Delete            | **Delete**, or **Delete block** on a block                                                                                                                                                                                                                                                                                                                                                                                                          |

An entry that cannot act on the selection stays in the menu, greyed, and its tooltip says why, for example **Select one element.** or **Copy an element first.**

- **Paste Here** puts the copied element into the container under the point you right-clicked. **Paste to Replace** puts it in place of the selection.
- **Copy Style** keeps the style of the element, and **Paste Style** puts it on every selected element, which keeps its own place in the layout.
- **Copy link to selection** copies a link to the project that opens with these elements selected.
- **Bring to Front**, **Bring Forward**, **Send Backward** and **Send to Back** change how the element is drawn over its siblings; it keeps its place in the layer tree. **Flip Horizontal** and **Flip Vertical** mirror the element in place; flip it again to turn it back. These act on one selected element.
- **Use as mask** uses the picture or gradient of the selected layer as a mask for the layer after it.
- **Hide** makes the element invisible and keeps its space. **Hide and Collapse** removes it from the layout.
- **Lock** keeps the element from being picked, moved or resized on the canvas, and **Rename** gives its layer a name of your own. See [Layers](/features/design/layers).
- **Add motion** opens the **Animation & Effects** section of the [Styles](/features/design/styles#animation-and-effects) panel, ready to add an effect.
- **Create component** moves the element into its own component file and uses that component in its place. See [Components](/features/design/components).
- **Select Matching** adds every element drawn from the same place in your code, in the same frame: every copy of a component, or every item of a list.
- **Save as block** adds the element to **My Blocks** so you can reuse it. See [Blocks](/features/design/blocks). **Set as thumbnail** makes a picture of the element the project's picture.

Right-click a frame, with no element selected, to **Duplicate** it, **Set as thumbnail** or **Delete** it.

## Move around

- **Scroll** to pan. Hold `Shift` while you scroll to pan sideways.
- Hold `Space` and drag, or drag with the middle mouse button, to pan.
- Hold `Cmd` (Mac) or `Ctrl` (Windows) and scroll to zoom around the pointer.
- Drag on an empty part of the canvas to select several frames.

If you lose your frames, a bar appears at the bottom of the canvas. Its arrow points to your design. **Back to design** brings the top of your first page into the middle of the canvas at the same zoom, and **Fit all** (`Cmd/Ctrl + 0`) shows every frame. **Re-Center Canvas** in the zoom menu does the same as **Back to design**.

The bar at the bottom of an empty canvas: an arrow toward the design, Your design is off screen, Fit all with its shortcut and the Back to design button.

> [!NOTE]
>
> **Every change is code**
>
> Style changes are saved as Tailwind CSS classes on the element in your source file. Moves, wraps and deletes change your JSX. Open the element in the code panel at any time to see the result.

## Shortcuts

| Action                                      | Shortcut                                         |
| ------------------------------------------- | ------------------------------------------------ |
| Select tool                                 | `V`                                              |
| Pan tool                                    | `H`                                              |
| Annotate                                    | `M`                                              |
| Move axes                                   | `W`                                              |
| Hold to pan                                 | `Space`                                          |
| Show distances                              | Hold `Alt`                                       |
| Edit text, or select what the element holds | `Enter`                                          |
| Select the element around it                | `Shift + Enter`                                  |
| Select the next / previous element          | `Tab` / `Shift + Tab`                            |
| Cycle the layers under the pointer          | `Alt` + click (`Option` + click on a Mac)        |
| Select matching layers                      | `Cmd/Ctrl + Alt + A`                             |
| Lock or unlock                              | `Cmd/Ctrl + Alt + L`                             |
| Leave the current action                    | `Esc`                                            |
| Undo / Redo                                 | `Cmd/Ctrl + Z` / `Cmd/Ctrl + Shift + Z`          |
| Copy / Paste / Cut                          | `Cmd/Ctrl + C` / `V` / `X`                       |
| Duplicate                                   | `Cmd/Ctrl + D`                                   |
| Delete                                      | `Delete` or `Backspace`                          |
| Wrap / Unwrap                               | `Cmd/Ctrl + G` / `Cmd/Ctrl + Shift + G`          |
| Move up / down among siblings               | `Shift + Arrow Up` / `Shift + Arrow Down`        |
| Insert a container / text                   | `R` / `T`                                        |
| Zoom in / out / fit                         | `Cmd/Ctrl + =` / `Cmd/Ctrl + -` / `Cmd/Ctrl + 0` |
| Zoom to the selection                       | `Shift + 2`                                      |
| Wireframe view / Pixel grid                 | `Shift + W` / `Shift + P`                        |
| Copy Style / Paste Style                    | `Cmd/Ctrl + Alt + C` / `Cmd/Ctrl + Alt + V`      |
| Bring to Front / Send to Back               | `Cmd/Ctrl + Alt + ]` / `Cmd/Ctrl + Alt + [`      |
| Flip horizontal / vertical                  | `Shift + H` / `Shift + V`                        |
| Add the selection to the chat               | `Cmd/Ctrl + Shift + L`                           |
| Command palette                             | `Cmd/Ctrl + K`                                   |
| Show all shortcuts                          | `?` (`Shift + /`)                                |

## FAQ

### Why can I not edit anything?

You may have view-only access to the project. A **View only** badge shows in the editor. Ask an owner for edit access. See [Members and roles](/features/collaborate/members-and-roles).

### The frame shows Preview disconnected. What do I do?

The sandbox stopped responding and Lyna restarts it for you. Choose **Retry now**, or **Restart sandbox** in the bottom bar.

## Related

- [Frames and devices](/features/design/frames-and-devices): Check your app at every screen size.
- [Styles](/features/design/styles): Every style property of an element.
- [Layers](/features/design/layers): The element tree of each page.
- [Blocks](/features/design/blocks): Add ready-made sections.
