# Layers

Find any element of a frame in its tree, hide or lock it, reorder it by dragging and add blocks between rows.

Use the **Layers** panel to reach elements that are hard to click on the canvas, like a wrapper or a hidden menu. It shows the elements of each frame as a tree, in the order they appear in your code.

The Layers panel with a nested element tree, one row selected and the eye button on hover.

## What you can do

- Select any element from its row. The canvas selects it too.
- Search layers by name and filter them by type.
- Hide or show an element.
- Lock a layer so the canvas leaves it alone.
- Give a layer a name of your own, or rename a component.
- Reorder elements by dragging rows.
- Add a block or a form between two rows.
- Expand or collapse the whole tree at once.

## Open the panel

Choose **Layers** in the rail on the left of the editor. Choose it again, or the close button, to close the panel. `Cmd/Ctrl + /` shows or hides the whole left panel.

## Read the tree

- There is one root row per frame. Under it, each row is an element of the page.
- An element that comes from one of your components shows the component icon.
- A box that lays out its content shows how: side by side for a row, stacked for a column, a small grid for a grid. The icon follows your changes in the Styles panel.
- Hover a text row to see its text in a tooltip.
- Selecting an element on the canvas scrolls its row into view.
- Choose **Expand all** or **Collapse all** in the panel header.
- Right-click a row to open the same menu as on the canvas. See [The right-click menu](/features/design/canvas#the-right-click-menu).

On the canvas, right-click and choose **Select Layer** to list the layers under the pointer, or Alt-click to step through them. See [What a click selects](/features/design/canvas#what-a-click-selects).

## Find a layer

Type in **Search layers** to find elements by name. Open **Filter by type** to show only **Components**, **Text**, **Media**, **Links and controls** or **Containers**. The panel shows the number of matches. Choose **Clear filters** to see the whole tree again.

## Hide a layer

Hover a row and choose the eye button (**Hide layer**). The element becomes invisible on the page but keeps its space. Choose the button again (**Show layer**) to bring it back.

The change is written to your code as a style on the element, so it is also hidden in your published app. To remove an element from the layout instead, right-click it and choose **More**, then **Hide and Collapse**.

## Lock a layer

Hover a row and choose the lock button (**Lock layer**), next to the eye. A locked layer stays as it is on the canvas: clicks pass through it to what lies under it, like the text over a locked background, and the locked layer cannot be dragged, resized or edited from the canvas. You can still select it from its row and change it in the panels. Choose the button again (**Unlock layer**) to free it.

You can also right-click an element and choose **Lock** or **Unlock**, or press `Cmd/Ctrl + Alt + L`. Locking one item of a list locks every item of that list. A lock only helps you edit: it is never written to your code, and it stays in this browser for this project, so it is still there after a reload.

The Layers panel with layout icons for rows, lists and grids, and the selected Book a demo link row with its lock and eye buttons, next to the same link selected on the page.

## Rename a layer

Double-click a row, or right-click it and choose **Rename**. Type a name and press `Enter`, or `Esc` to cancel. The name shows in the tree and on the label of the selection on the canvas. It is a label for you only: it is never written to your code, and it stays in this browser for this project. Clear the name to show the default one again.

On the layer of one of your components, a rename renames the component itself in your code: its name, every place that uses it and, when the file has the same name, its file and the imports that point to it. It is one step you can undo. If the name is already used or the component comes from a package, nothing changes and Lyna tells you why.

On a phone, the selected row has a menu button with **Rename**, **Duplicate**, **Move up**, **Move down** and **Delete**, so nothing needs a double tap or a drag.

## Reorder by dragging

1. ### Drag a row

   Press a row and drag it up or down. A line shows where the element will land. Drop it on a container row to move the element inside it.
2. ### Drop it

   Release the row. Lyna moves the element in your code, even when the new parent lives in another file, and carries the imports it needs.

If a drop is not possible, the line turns red with the reason, for example:

- **The page frame can't be moved or receive elements**
- **This element can't contain other elements**
- **This element isn't in your code yet**
- **Move one layer at a time**

> [!NOTE]
>
> **Clear the filters to reorder**
>
> Reordering is off while a search or a type filter is active, because hidden rows would make the drop position unclear.

## Add a block between rows

Hover the gap between two rows, or an empty container. A small pill appears with two buttons: **+** opens the block picker, and the form button opens the form builder. The block or the form lands at that exact spot. See [Blocks](/features/design/blocks) and [Forms](/features/design/forms).

## Shortcuts

| Action                              | Shortcut                                  |
| ----------------------------------- | ----------------------------------------- |
| Show or hide the left panel         | `Cmd/Ctrl + /`                            |
| Add a row to the selection          | `Shift` + click                           |
| Lock or unlock the selected layer   | `Cmd/Ctrl + Alt + L`                      |
| Move the selected element up / down | `Shift + Arrow Up` / `Shift + Arrow Down` |
| Wrap / Unwrap                       | `Cmd/Ctrl + G` / `Cmd/Ctrl + Shift + G`   |
| Delete                              | `Delete` or `Backspace`                   |

## FAQ

### Can I rename a layer?

Yes. Double-click its row, or right-click it and choose **Rename**. On an element, the name is a label for you and your code does not change. On a component, the component is renamed in your code. See [Rename a layer](#rename-a-layer).

### Why can I not drag rows?

You need edit access to the project, and no search or filter may be active.

## Related

- [Blocks](/features/design/blocks): Add ready-made sections and elements.
- [Canvas](/features/design/canvas): Select and edit on the page.
- [Pages and routes](/features/design/pages-and-routes): Switch between the pages of your app.
