Viewport segmentsLimited availability
The viewport segment CSS environment variables and media features, and the viewport.segments API, allow you to adapt your layout to devices where the display is split, such as on foldable devices.
Not yet supported in all major browsers — check the table and provide a fallback.
Browser support
DesktopChrome
1–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155Edge
12–137Not supported
138+Supportedsince Jun 26, 2025
Current: 154Firefox
✕Not supportedup to 157
Current: 157Safari
✕Not supportedup to 27
Current: 27MobileChrome Android
18–137Not supported
138+Supportedsince Jun 24, 2025
Current: 155Firefox Android
✕Not supportedup to 157
Current: 157Safari iOS
✕Not supportedup to 27
Current: 27How to use
Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.
Example
Full syntax and examples are on MDN: Viewport.
Feature detection
JS · check before using
if ("Viewport" in globalThis && "segments" in Viewport.prototype) {
// Viewport.segments is available
}Sub-features
Support for each part of the feature (11). The overall table above shows when the whole feature works.
| Sub-feature | Chrome | Edge | Firefox | Safari | Chrome Android | Firefox Android | Safari iOS |
|---|---|---|---|---|---|---|---|
| Viewport | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| Viewport.segments | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| Window.viewport | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| @media.horizontal-viewport-segments | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| @media.vertical-viewport-segments | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-bottom | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-height | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-left | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-right | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-top | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |
| <env>.viewport-segment-width | 138 | 138 | ✕ | ✕ | 138 | ✕ | ✕ |