# Preview mode

Use your app like a visitor right on the canvas, to click links, fill forms and test every screen size without the editing tools in the way.

Use **Preview** mode to test your app like a visitor: links, menus, forms and hover states. The frames on the canvas become your running app, and clicks go to the page instead of selecting elements.

The editor in Preview mode with the Preview toggle active in the top bar and a phone frame showing an open menu.

## What you can do

- Click links and buttons, open menus and fill forms.
- Scroll each page inside its frame, as in a browser.
- Navigate between pages inside a frame.
- Check several screen sizes at once, one per frame.
- Watch animations and hover effects run.
- Open the page in a new browser tab.
- View protected pages as a signed-in visitor, without signing in.

## Switch to Preview

Use any of these:

- Choose **Preview** in the mode toggle at the top of the editor (**Design**, **Code**, **Preview**).
- Press `P`.
- Press `Cmd/Ctrl + 3`.

To go back to editing, choose **Design**, press `V`, or press `Esc`.

## What changes in Preview

- Selection outlines, the element toolbar and the editing overlays are hidden.
- Pointer and keyboard input goes to your app.
- Each frame shows one screen of its device, like a browser window of that size, whatever its frame height: **Full page**, **Device height** and **Fixed height** alike. The **Frame height** menu is hidden in Preview; back in Design, each frame has the height you chose again.
- The canvas zooms to 70% on the frame you work on (the selected frame, or the one most in view), with its whole screen in view when it fits. You can zoom while in Preview; the next time you open Preview it starts at 70% again.
- The chat stays where it is, so you can keep talking to the AI.

## Move around and scroll

Clicks, hovers and typing go to your app, and scrolling over a frame scrolls its page, as in a browser: a dialog opens in the middle of the frame, sticky headers stay at the top, a section sized to the screen fills the frame, and animations that follow the scroll play. When the page cannot scroll any further (a short page, or its end), your next scroll moves the canvas. Once you click inside the page, the arrow keys, `Page Down` and `Space` scroll it too.

To move around the canvas:

- Scroll beside a frame, or over a page that cannot scroll any further.
- Hold `Space` and drag. Release `Space` and you are still in Preview.
- Press `H` to use the hand: the pages stop taking the pointer, and dragging moves the canvas. Press `H` again or `Esc` to give the pointer back to your app.
- Pinch, or hold `Cmd/Ctrl` and scroll, to zoom the canvas.

Preview opens the page at the part you were looking at in Design, or at its top when the frame's top was in view. Back in **Design**, the canvas returns exactly to the zoom and position you left it at. If you moved to another frame or page in Preview, Design keeps your zoom and centres that frame.

> [!NOTE]
>
> **Test in a real browser tab too**
>
> Choose **Preview in new tab** in the frame bar to open the page in its own browser tab, at full size. The address is your sandbox preview, so it only works while the project is open.

## View as signed in

In Preview, a protected page sends a visitor who is not signed in to your app's sign-in page, as it does on your published site. When your app has protected pages, the frame bar shows **View as** with two choices:

- **Visitor** (the default): the sign-in rule applies.
- **Signed in**: protected pages open without signing in, and the frame bar shows a **Signed-in view** badge.

If a frame was sent to the sign-in page, the frame bar says the page requires sign-in and offers **View as signed in**, which switches the view and reopens the page.

The choice applies to every frame, lasts until you reload the editor, and starts again as **Visitor**. It changes only what you see in the editor: visitors to your site still need to sign in. See [Protected pages](/features/design/pages-and-routes#protected-pages).

## Shortcuts

| Action                   | Shortcut              |
| ------------------------ | --------------------- |
| Preview mode             | `P` or `Cmd/Ctrl + 3` |
| Design mode              | `V` or `Cmd/Ctrl + 1` |
| Code mode                | `C` or `Cmd/Ctrl + 2` |
| Back to Design           | `Esc`                 |
| Hand, to move the canvas | `H`, or hold `Space`  |

## Related

- [Frames and devices](/features/design/frames-and-devices): Add frames at other screen sizes.
- [DevTools](/features/test-and-debug/devtools): Inspect the console and network while you test.
- [Publishing](/features/publish/publishing): Share a live version of your app.
