Repository navigation
Description
Description
Foldable phones, tablets, and multi-posture laptops represent a growing segment of hardware. While the Device Posture API indicates how a device is held (e.g., folded vs continuous), developers need exact geometric segment boundaries to position columns, sidebars, and critical interface elements without content falling into a physical hinge or fold seam.
The latter is provided by the Viewport Segments API. It exposes the positions, dimensions, and count of logically separate viewport regions formed when a viewport is split across physical folds, hinges, or dual-screen displays. It provides both declarative CSS tools (@media (*-viewport-segments) and env(viewport-segment-* x y)) and imperative JavaScript properties (window.viewport.segments).
Spec links:
- https://drafts.csswg.org/css-viewport/#dom-viewport-segments
- https://drafts.csswg.org/css-env-1/#viewport-segments
- https://www.w3.org/TR/mediaqueries-5/#mf-horizontal-viewport-segments
Specification
(See description, as there are several specs involved)
web-feature
viewport-segments
Test Links
Additional Signals
- Blink / Chromium:
- Gecko / Firefox:
- Not implemented
- Standards Position: no position
- WebKit / Safari:
- Available behind a feature flag in Safari 27.1 beta (simulator)
- Standards Position: no position
(This features goes hand-in-hand with the Device Posture API, but serves a different purpose)
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTodo
Activity
github-actions commentedon Sep 22, 2026
This comment was automatically generated based on the information you provided. Please don't edit it.
Below is additional information about the web feature (from the web-features project) which is referenced in your proposal.
If this doesn't accurately correspond to your proposal, please update your initial comment to include
web-features: <feature-id>.To find feature IDs, use the web-features explorer.
Feature Viewport segments
viewport.segmentsAPI, allow you to adapt your layout to devices where the display is split, such as on foldable devices.horizontal-viewport-segmentsCSS media feature,vertical-viewport-segmentsCSS media feature