Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The viewport read-only property of the Window interface returns a Viewport object instance, which provides information about the current state of the device's viewport.
See the Viewport API for all available properties.
A Viewport object instance.
viewport usageconst currentViewport = window.viewport;
const segments = window.viewport.segments;Viewport.segments propertyViewport interfaceVisualViewport interface