All posts
Web / News

Safari 27.1 Brings Fold-Aware Web APIs to iPhone Duo

Apple: iPhone Duo showing the home screen, from the WebKit Safari 27.1 announcement

Apple announced iPhone Duo on 23 October 2026, and WebKit published its Safari 27.1 feature notes the same day. For anyone who builds websites, the interesting part is not the hardware. It is two new developer previews that let a page know it is running on a folding screen.

The first is the Device Posture API. It reports whether the screen is folded or flat through a device-posture media query and navigator.devicePosture, with two values: folded and continuous. The second is the Viewport Segments API, which describes the display areas either side of the fold. It adds horizontal-viewport-segments and vertical-viewport-segments media queries, six viewport-segment environment variables, and window.viewport.segments in JavaScript.

Both sit behind feature flags for now. To switch them on, go to Settings, Apps, Safari, Advanced, Feature Flags, then enable Device Posture API and Viewport Segments API. Apple also says Xcode 27.1 or later includes Device Hub, which provides an iPhone Duo simulator, so you can test without owning the device.

Viewport sizes on iPhone Duo range from 382 to 951 CSS pixels wide and 368 to 902 tall, depending on pose. That spread matters. A layout that assumes a phone width or a tablet width will meet both on the same device within seconds, so fluid grids and container queries will do more work than fixed breakpoints.

One caveat from Apple's own notes: web content does not yet extend behind the system controls on the outer display, and Apple is asking for feedback on a better approach. Safari 27.1 also adds a user-facing feature, showing PDFs two pages side by side when the phone is partly folded like a book.

For our web builds in Marlow, the practical step is small. We will add iPhone Duo to the device test list, check that nothing important sits across the fold line, and avoid building fold-specific layouts until the flags become defaults. It is early, but cheap to prepare for.