<XrSessionMenu>
The way out of an immersive session for tracked hands. A pinch with the palm turned toward your face (the Quest "menu" gesture, left hand by default) opens a dialog in front of you: Leave VR? with Stay and Exit VR.
Quest Browser is meant to end the session on a left-hand palm pinch by itself, but in practice it does not always. This makes the gesture dependable, and asks first, so a stray pinch never throws the user out.
Usage
Put one in the scene, at the top level:
vue
<XrScene>
<MyScene />
<XrSessionMenu />
</XrScene>- The gesture is checked when the pinch starts (palm within 50° of the eyes) and acted on when it ends, so the same pinch cannot also press a button in the dialog.
hand:left(default),rightorboth. The right palm pinch is the Quest system button; leave it to the system.v-model:openopens it from code too, e.g. from a "Menu" button (that is the way with controllers).:gesture="false"leaves only that.title,hint,exitLabelandstayLabelchange its text.- An
<XrHandMenu>on the same hand opens on the same palm pose: pass:gesture="!handMenuOpen", or put one of them on the other hand. - The default slot replaces the hint text in the dialog: settings, a recenter tip.
- It only shows during a session, and closes when the session ends.
Pair it with a visible <XrExitButton>: a gesture nobody told you about is not a way out.
There is no live demo on this page: the menu only exists inside a session. Try it in the playground on a Quest.
API
Props
| Prop | Type | Default | Description |
|---|---|---|---|
parts | Partial<Record<"hint" | "stay" | "exit", Record<string, unknown>>> | Raw uikit properties per inner part, merged after the defaults: hint, stay and exit (the buttons). | |
hint | string | 'You can come back with the Enter button.' | Hint in the dialog when the default slot is empty. |
open | boolean | undefined | Whether the menu is open (v-model:open). Without it the menu keeps its own state. |
hand | "left" | "right" | "both" | 'left' | The hand whose palm pinch opens it: left (the Quest menu hand), right, or both. |
gesture | boolean | true | Open on the palm pinch. false leaves only v-model:open. |
stayLabel | string | 'Stay' | Label of the button that closes the menu and stays. |
title | string | Dialog title. Defaults to "Leave VR?" or "Leave AR?" for the running session. | |
exitLabel | string | Label of the button that ends the session. Defaults to "Exit VR" or "Exit AR". |
Events
| Event | Payload | Description |
|---|---|---|
exit | Exit was pressed: the session is ending. | |
update:open | open: boolean | The menu opened or closed (v-model:open). |