Skip to content
Merged
12 changes: 5 additions & 7 deletions code/core/src/viewport/defaults.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { ViewportMap } from './types';

const INITIAL_VIEWPORTS_DATA = {
export const INITIAL_VIEWPORTS = {
iphone5: {
name: 'iPhone 5',
styles: {
Expand Down Expand Up @@ -225,15 +225,13 @@ const INITIAL_VIEWPORTS_DATA = {
},
type: 'mobile',
},
} as const;
} as const satisfies ViewportMap;

export type InitialViewportKeys = keyof typeof INITIAL_VIEWPORTS_DATA;

export const INITIAL_VIEWPORTS: ViewportMap = INITIAL_VIEWPORTS_DATA;
export type InitialViewportKeys = keyof typeof INITIAL_VIEWPORTS;

export const DEFAULT_VIEWPORT = 'responsive';

export const MINIMAL_VIEWPORTS: ViewportMap = {
export const MINIMAL_VIEWPORTS = {
mobile1: {
name: 'Small mobile',
styles: {
Expand Down Expand Up @@ -266,4 +264,4 @@ export const MINIMAL_VIEWPORTS: ViewportMap = {
},
type: 'desktop',
},
};
} as const satisfies ViewportMap;
6 changes: 2 additions & 4 deletions docs/essentials/viewport.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ By default, the viewport feature will use a minimal set of viewports, which enab
| `mobile1` | Small mobile | 320 × 568 |
| `mobile2` | Large mobile | 414 × 896 |
| `tablet` | Tablet | 834 × 1112 |
| `desktop` | Desktop | 1024 × 1280 |

If you need a more detailed set of devices, you can use the [`INITIAL_VIEWPORTS` export](#initial_viewports), which includes the following devices:

Expand Down Expand Up @@ -59,13 +60,10 @@ If you need a more detailed set of devices, you can use the [`INITIAL_VIEWPORTS`
| `nexus6p` | Nexus 6P | 412 × 732 |
| `pixel` | Pixel | 540 × 960 |
| `pixelxl` | Pixel XL | 720 × 1280 |
| `mobile1` | Small mobile<br />(also in `MINIMAL_VIEWPORTS`) | 320 × 568 |
| `mobile2` | Large mobile<br />(also in `MINIMAL_VIEWPORTS`) | 414 × 896 |
| `ipad` | iPad | 768 × 1024 |
| `ipad10p` | iPad Pro 10.5-in | 834 × 112 |
| `ipad10p` | iPad Pro 10.5-in | 834 × 1112 |
| `ipad11p` | iPad Pro 11-in | 834 × 1194 |
| `ipad12p` | iPad Pro 12.9-in | 1024 × 1366 |
| `tablet` | Tablet<br />(also in `MINIMAL_VIEWPORTS`) | 834 × 1112 |

To use the detailed set of devices, you can adjust the `options` property in your configuration to include the `INITIAL_VIEWPORTS` export:

Expand Down