Note: This documentation is for the old 0.2.0 version of A-Frame. Check out the documentation for the current 1.6.0 version

The canvas component allows us to specify our own canvas or the size of the injected canvas. The canvas component applies only to the <a-scene> element.


We can specify our own canvas.

<a-scene canvas="canvas: #mycanvas"></a-scene>

Or specify the width and height in percent of the injected canvas.

<a-scene canvas="height: 50; width: 50"></a-scene>


Property Description Default Value
canvas Selector to a canvas element that exists on the page. null
height Height of the injected canvas, in percentage. 100
Width Width of the injected canvas, in percentage. 100