File: ARButton.md | Updated: 11/15/2025
A utility class for creating a button that allows to initiate immersive AR sessions based on WebXR. The button can be created with a factory method and then appended ot the website's DOM.
document.body.appendChild( ARButton.createButton( renderer ) );
ARButton is an addon, and must be imported explicitly, see Installation#Addons.
import { ARButton } from 'three/addons/webxr/ARButton.js';
Constructs a new AR button.
renderer | The renderer.
---|---
sessionInit | The a configuration object for the AR session.
Returns: The button or an error message if immersive-ar isn't supported.