demo · v132

Device Posture — live probe

If your browser exposes navigator.devicePosture, the value updates live as your device's physical posture changes. The miniature device on the right is a visual stand-in: the "simulate fold" button just toggles the CSS for illustration.

navigator.devicePosture: checking…
@media (device-posture): checking…
type: —
screen left
screen right
change events will be logged here

the code

navigator.devicePosture.addEventListener("change", () => {
  console.log(navigator.devicePosture.type); // "continuous" or "folded"
});

see also