|
| 1 | +--- |
| 2 | +title: Device Preview |
| 3 | +--- |
| 4 | + |
| 5 | +:::info Pro Feature |
| 6 | +[Upgrade to Phoenix Code Pro](https://phcode.io/pricing) to access this feature. |
| 7 | +::: |
| 8 | + |
| 9 | +**Device Preview** lets you check how your page looks at different screen widths without leaving Phoenix Code. Resize the Live Preview to common device sizes, snap to the CSS breakpoints from your stylesheets, or drag the panel edge to see a width ruler with tick marks and breakpoint bands. |
| 10 | + |
| 11 | +<!-- Add an image here showing the Live Preview toolbar with the device-size button on the right and the width ruler visible during a resize --> |
| 12 | + |
| 13 | +## Choosing a device size |
| 14 | + |
| 15 | +The right end of the Live Preview toolbar has a device-size button. |
| 16 | + |
| 17 | +- Click the **device icon** to cycle through phone, tablet, and desktop widths. |
| 18 | +- Click the **chevron** beside it to open the full device list. |
| 19 | + |
| 20 | +<!-- Add an image here showing the device-size dropdown with the list of devices and CSS breakpoint entries --> |
| 21 | + |
| 22 | +The dropdown lists predefined devices grouped by category (iPhone SE, iPhone 14, Galaxy S24, iPad Mini, iPad Air, iPad Pro, HD Desktop, Laptop, Desktop, Full HD), plus a **Fit** option in design mode that fills the available space. A check mark shows next to the size that matches the current width. |
| 23 | + |
| 24 | +> Free users see the device list, but selecting any size opens a Pro upgrade prompt. Device Preview is a Phoenix Pro feature. |
| 25 | +
|
| 26 | +## CSS breakpoints |
| 27 | + |
| 28 | +Phoenix Code reads your page's stylesheets and picks up any `min-width` or `max-width` media-query breakpoints. These show up in two places: |
| 29 | + |
| 30 | +- In the **device dropdown**, listed at the bottom as `@media 768px` (etc.). Clicking one snaps the Live Preview to that exact width. |
| 31 | +- On the **width ruler**, as colored bands between breakpoints, each labelled with its pixel value. |
| 32 | + |
| 33 | +Breakpoints update automatically as you edit your CSS. |
| 34 | + |
| 35 | +<!-- Add an image here showing CSS breakpoint entries (@media labels) at the bottom of the device dropdown --> |
| 36 | + |
| 37 | +## Width ruler |
| 38 | + |
| 39 | +When you drag the edge of the Live Preview panel to resize it, a ruler appears across the toolbar showing: |
| 40 | + |
| 41 | +- **Tick marks** every 10px, with numbers every 100px. |
| 42 | +- **Colored bands** for each CSS breakpoint range (see [CSS breakpoints](#css-breakpoints) above). |
| 43 | +- **A blue line** at the right edge marking the current width. |
| 44 | + |
| 45 | +A small black label floats above the preview showing the current width and the closest matching device, like `iPad Mini — 768px`. The label also flashes briefly when you pick a size from the device dropdown. |
| 46 | + |
| 47 | +The ruler disappears as soon as you stop resizing. |
| 48 | + |
| 49 | +<!-- Add an image here showing the width ruler with tick marks, colored breakpoint bands, the blue right-edge marker, and the floating device label --> |
0 commit comments