This feature is not Baseline because it does not work in some of the most widely-used browsers.
Secure context: This feature is available only in secure contexts (HTTPS), in some or all supporting browsers.
Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.
The XRCompositionLayer interface of the WebXR Device API is a base class that defines a set of common properties and behaviors for WebXR layer types. It is not constructable on its own.
Several layer types inherit from XRCompositionLayer:
XRCompositionLayer itself inherits from the general XRLayer class (which inherits from EventTarget).
XRCompositionLayer.blendTextureSourceAlpha Experimental
A boolean enabling the layer's texture alpha channel.
XRCompositionLayer.layout Read only Experimental
The layout type of the layer.
XRCompositionLayer.mipLevels Read only Experimental
The number of mip levels in the color and texture data for the layer.
XRCompositionLayer.needsRedraw Read only Experimental
A boolean signaling that the layer should be re-rendered in the next frame.
Inherits methods from its parent, EventTarget.
XRCompositionLayer.destroy() Experimental
Deletes the underlying layer attachments.
| Specification |
|---|
| WebXR Layers API Level 1> # xrcompositionlayertype> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
XRCompositionLayer |
No | No | No | No | No | No | No | No | No | No | No | No |
blendTextureSourceAlpha |
No | No | No | No | No | No | No | No | No | No | No | No |
destroy |
No | No | No | No | No | No | No | No | No | No | No | No |
layout |
No | No | No | No | No | No | No | No | No | No | No | No |
mipLevels |
No | No | No | No | No | No | No | No | No | No | No | No |
needsRedraw |
No | No | No | No | No | No | No | No | No | No | No | No |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/XRCompositionLayer