Back to Content

XRViewport: width property

files/en-us/web/api/xrviewport/width/index.md

latest633 B
Original Source

{{APIRef("WebXR Device API")}}{{SecureContext_Header}}

The read-only {{domxref("XRViewport")}} property width specifies the width of the viewport, in pixels, onto the drawing surface the 3D scene is to be rendered into. This is defined using this property along with the viewport's {{domxref("XRViewport.height", "height")}} and its origin given by its properties {{domxref("XRViewport.x", "x")}} and {{domxref("XRViewport.y", "y")}}.

Value

The viewport's width in pixels.

Examples

See the main {{domxref("XRViewport")}} page for examples.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}