• Skip to main content
  • Skip to search
  • Skip to select language
    • Technologies Overview
    • HTML
    • CSS
    • JavaScript
    • Graphics
    • HTTP
    • APIs
    • Browser Extensions
    • MathML
    • Learn web development
    • Tutorials
    • References
    • Developer Guides
    • Accessibility
    • Game development
    • ...more docs
    • Send Feedback
    • Contribute to MDN
    • Report a content issue 🌐
    • Report a platform issue 🌐
  1. Web technology for developers
  2. Web APIs
  3. XRViewport
  4. XRViewport.width

Table of contents

  • Value
  • Examples
  • Specifications
  • Browser compatibility

XRViewport.width

The read-only 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 height and its origin given by its properties x and y.

Value

The viewport's width in pixels.

Examples

See the main XRViewport page for examples.

Specifications

Specification
WebXR Device API
# dom-xrviewport-width

Browser compatibility

BCD tables only load in the browser

Found a problem with this page?

  • Edit on GitHub
  • Source on GitHub
  • Report a problem with this content on GitHub
  • Want to fix the problem yourself? See our Contribution guide.

Last modified: Sep 2, 2021, by MDN contributors

Related Topics

  1. WebXR Device API
  2. XRViewport
  3. Properties
    1. height
    2. width
    3. x
    4. y
  4. Related pages for WebXR Device API
    1. Navigator.xr
    2. WebGLRenderingContext.makeXRCompatible()
    3. XRAnchor
    4. XRBoundedReferenceSpace
    5. XRCPUDepthInformation
    6. XRDepthInformation
    7. XRFrame
    8. XRInputSource
    9. XRInputSourceArray
    10. XRInputSourceEvent
    11. XRInputSourcesChangeEvent
    12. XRPose
    13. XRReferenceSpace
    14. XRReferenceSpaceEvent
    15. XRRenderState
    16. XRRigidTransform
    17. XRSession
    18. XRSessionEvent
    19. XRSpace
    20. XRSystem
    21. XRView
    22. XRViewerPose
    23. XRWebGLBinding
    24. XRWebGLDepthInformation
    25. XRWebGLLayer
  • Web Technologies
  • Learn Web Development
  • About MDN
  • Feedback
  • About
  • MDN Web Docs Store
  • Contact Us
  • Firefox

MDN

  • MDN on Twitter
  • MDN on Github

Mozilla

  • Mozilla on Twitter
  • Mozilla on Instagram

© 2005-2022 Mozilla and individual contributors. Content is available under these licenses.

  • Terms
  • Privacy
  • Cookies