<XrEnterButton>
A regular DOM button that starts or ends an XR session. Put it next to <TresCanvas>, not inside it. It renders a plain <button class="xr-enter-button"> with a data-state of ready, presenting or unavailable, so styling is up to you. data-mode says which session it starts (vr or ar).
The Enter VR button in the demo's corner is an <XrEnterButton mode="vr">. Where the browser has no WebXR device it is disabled and reads VR not available; this site hides it then (button:disabled { display: none }), so open the page on a Quest to see it.
Usage
vue
<XrEnterButton mode="vr" />
<!-- passthrough on a Quest 3 / Quest Pro, VR elsewhere -->
<XrEnterButton mode="auto" />
<XrEnterButton mode="ar" v-slot="{ label }">{{ label }} (passthrough)</XrEnterButton>API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
mode | "auto" | "ar" | "vr" | 'vr' | Which session it starts: vr (immersive), ar (passthrough, mixed reality), or auto: passthrough wherever immersive-ar is supported (Quest 3 and Pro in colour, Quest 2 in grey), else VR. |