Skip to content

API in Capabilities

Device Posture API (foldables)

Published

The navigator.devicePosture property exposes a DevicePosture object for reading the applied posture and receiving posture changes. The specification defines "continuous" and "folded" values.

BCD records the API from Chrome 132 and Samsung Internet 16.2, with Chromium-derived entries mirrored from Chrome. It records no support in Firefox or desktop Safari; Safari on iOS 27 records support behind the DevicePostureEnabled preference.

const posture = navigator.devicePosture.type;
navigator.devicePosture.addEventListener('change', handlePostureChange);

The specification exposes navigator.devicePosture to Window in secure contexts.

Member Type Meaning
type DevicePostureType Returns the document’s current applied posture as "continuous" or "folded".
change event Fires on the DevicePosture object after the applied posture changes.

The DevicePosture interface inherits from EventTarget. The devicePosture property returns the same object on repeated access, as specified by [SameObject].

None.

These examples preserve a single-pane layout when posture information is unavailable or does not report a fold.

Switching between folded and single-pane layouts

Section titled “Switching between folded and single-pane layouts”

This example detects the API, applies the current posture, and uses a single-pane class when the API is unavailable.

function applyPosture(type) {
document.documentElement.classList.toggle('is-folded', type === 'folded');
document.documentElement.classList.toggle('is-single-pane', type !== 'folded');
}
if ('devicePosture' in navigator) {
applyPosture(navigator.devicePosture.type);
navigator.devicePosture.addEventListener('change', () => {
applyPosture(navigator.devicePosture.type);
});
} else {
applyPosture('continuous');
}

The fallback selects the same single-pane layout used for the specified "continuous" value. It does not infer whether the physical device can fold.

The specification also defines the device-posture media feature. This rule changes the layout only when the user agent reports folded.

.workspace {
display: block;
}
@media (device-posture: folded) {
.workspace {
display: grid;
grid-template-columns: 1fr 1fr;
}
}

When the media feature is unsupported or does not match, the block layout remains in effect.

Specifications

SpecificationStatus
DevicePosture interfaceW3C draft