Skip to main content

ARButton

ARButton adds a small "Enter AR" button at the right-bottom of your canvas, which can automatically detect AR availability.

import View3D, { ARButton } from "@egjs/view3d";
import "@egjs/view3d/css/view3d-ar.min.css"; // If you're not using the bundled CSS (view3d-bundle.css)

const view3D = new View3D(...);

view3D.loadPlugins(new ARButton({
unavailableText: "A text that will be shown above the button when AR is not available"
}));

Options

OptionTypeDefaultDescription
availableTextstring"View in AR"A text that will be shown on mouse hover when it's available to enter the AR session
unavailableTextstring"AR is not available in this browser"A text that will be shown on mouse hover when it's not available to enter the AR session
buttonClassstring"view3d-ar-button"A class that will be applied to the button element
tooltipClassstring"view3d-tooltip"A class that will be applied to the tooltip element