Skip to content

PageMediaData

PageMediaData #

Represents the environmental metrics of a page or window.

This data is updated whenever the platform window or layout changes, such as when rotating a device, resizing a browser window, or adjusting system UI elements like the keyboard or safe areas.

device_pixel_ratio #

device_pixel_ratio: float

The number of device pixels for each logical pixel.

padding #

padding: Padding

The space surrounding the entire display, accounting for system UI like notches and status bars.

view_insets #

view_insets: Padding

Areas obscured by system UI overlays, such as the on-screen keyboard or system gesture areas.

view_padding #

view_padding: Padding

Similar to padding, but includes padding that is always reserved (even when the system UI is hidden).