Secure context
This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.

The read-only XRViewport interface's x property indicates the offset from the left edge of the destination surface (typically a XRWebGLLayer to the left edge of the viewport within the surface into which WebXR content is to be rendered. The viewport's y property identifies the y component of the origin, and its is given by the width and height properties.


x = xrViewport.x;


The offset from the left edge of the rendering surface to the left edge of the viewport, in pixels.


See the main XRViewport page for examples.


Specification Status Comment
WebXR Device API
The definition of 'XRViewport.x' in that specification.
Working Draft Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
xChrome Full support 79Edge Full support 79Firefox No support NoIE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android Full support 79Firefox Android No support NoOpera Android No support NoSafari iOS No support NoSamsung Internet Android Full support 11.2


Full support  
Full support
No support  
No support