pmndrs/xr

๐Ÿคณ VR/AR for react-three-fiber

TypeScript

2,616

414 commits

updated Oct 3, 2026

See the code

README

xr

Turn any R3F app into an interactive immersive experience.


NPM NPM Twitter Discord

npm install three @react-three/fiber @react-three/xr@latest

What does it look like?

A simple scene with a mesh that toggles its material color between "red" and "blue" when clicked through touching or pointing.recording of interacting with the code below
import { Canvas } from '@react-three/fiber'
import { XR, createXRStore } from '@react-three/xr'
import { useState } from 'react'

const store = createXRStore()

export function App() {
  const [red, setRed] = useState(false)
  return (
    <>
      <button onClick={() => store.enterAR()}>Enter AR</button>
      <Canvas>
        <XR store={store}>
          <mesh pointerEventsType={{ deny: 'grab' }} onClick={() => setRed(!red)} position={[0, 1, -1]}>
            <boxGeometry />
            <meshBasicMaterial color={red ? 'red' : 'blue'} />
          </mesh>
        </XR>
      </Canvas>
    </>
  )
}

How to enable XR for your @react-three/fiber app?

  1. const store = createXRStore() create a xr store
  2. store.enterAR() call enter AR when clicking on a button
  3. <XR>...</XR> wrap your content with the XR component

... or read this guide for converting a react-three/fiber app to XR.

Tutorials

External Tutorials

Roadmap

  • ๐Ÿคณ XR Gestures
  • ๐Ÿ•บ Tracked Body

Migration guides

Sponsors

This project is supported by a few companies and individuals building cutting-edge 3D Web & XR experiences. Check them out!

Sponsors Overview

ar
react
react-three-fiber
vr
webxr

pmndrs/xr

๐Ÿคณ VR/AR for react-three-fiber

TypeScript

2,616

414 commits

updated Oct 3, 2026

See the code

README

xr

Turn any R3F app into an interactive immersive experience.


NPM NPM Twitter Discord

npm install three @react-three/fiber @react-three/xr@latest

What does it look like?

A simple scene with a mesh that toggles its material color between "red" and "blue" when clicked through touching or pointing.recording of interacting with the code below
import { Canvas } from '@react-three/fiber'
import { XR, createXRStore } from '@react-three/xr'
import { useState } from 'react'

const store = createXRStore()

export function App() {
  const [red, setRed] = useState(false)
  return (
    <>
      <button onClick={() => store.enterAR()}>Enter AR</button>
      <Canvas>
        <XR store={store}>
          <mesh pointerEventsType={{ deny: 'grab' }} onClick={() => setRed(!red)} position={[0, 1, -1]}>
            <boxGeometry />
            <meshBasicMaterial color={red ? 'red' : 'blue'} />
          </mesh>
        </XR>
      </Canvas>
    </>
  )
}

How to enable XR for your @react-three/fiber app?

  1. const store = createXRStore() create a xr store
  2. store.enterAR() call enter AR when clicking on a button
  3. <XR>...</XR> wrap your content with the XR component

... or read this guide for converting a react-three/fiber app to XR.

Tutorials

External Tutorials

Roadmap

  • ๐Ÿคณ XR Gestures
  • ๐Ÿ•บ Tracked Body

Migration guides

Sponsors

This project is supported by a few companies and individuals building cutting-edge 3D Web & XR experiences. Check them out!

Sponsors Overview

ar
react
react-three-fiber
vr
webxr

Project health

Latest release

6.6.31 ยท Sep 28, 2026

Releases this year

4

Significant stargazers

Vlad Filippov

1,961 followers ยท starred Feb 2021

โ€”

4,243 followers ยท starred May 2020

jxom

1,231 followers ยท starred Feb 2022

utzcoz

126 followers ยท starred Aug 2025