← Back to release summary

Viewport Segments Enumeration API

Category
Device
Type
New or changed feature
Status
Origin trial (Chrome 138)
Intent stage
Start prototyping

Summary

The Viewport Segments API allows developers to adapt their website/webapp layout to target foldable devices. The viewport segments defines the position and dimensions of a logically separate region of the viewport. Viewport segments are created when the viewport is split by one or more hardware features (such as a fold or a hinge between separate displays) that act as a divider; segments are the regions of the viewport that can be treated as logically distinct by the author.

Motivation

Add a new CSS/JavaScript API to enable web developers to target a new class of foldable devices. JS API spec: https://drafts.csswg.org/css-viewport/#segments

Standards & signals

Docs: https://github.com/WICG/visual-viewport/blob/gh-pages/segments-explainer/SEGMENTS-EXPLAINER.md

Samples: https://github.com/foldable-devices/demos

Explainers: https://github.com/WICG/visual-viewport/blob/gh-pages/segments-explainer/SEGMENTS-EXPLAINER.md

View on chromestatus.com