Ballpit XR Emoji Gemini Icebreakers
NPM Package arXiv arXiv License
From idea to reality — a lightweight, open-source toolkit for rapidly prototyping AI + XR experiences on the open web.
XR Blocks is a cross-platform JavaScript/TypeScript SDK built on three.js and WebXR that makes spatial computing approachable for both human creators and generative AI. It absorbs the incidental complexity of perception, rendering, and interaction behind high-level, human-centered primitives — user, world, ui, ai — so you can focus on the experience, not the plumbing.
Write once, run on an Android XR headset (e.g. Galaxy XR) or right in a desktop simulator in Chrome. Low floor, high ceiling. 🪜
Born at Google XR Labs and built together with the community. 🌈
| Capability | |
|---|---|
| 🖐️ | Hands & gestures — joint tracking, pinch/fist/point/spread, custom on-device models |
| 🌍 | World understanding — depth sensing, real-world occlusion, plane / object / scene-mesh detection |
| 🤖 | AI integration — Gemini & OpenAI multimodal queries, Gemini Live, image generation, agents |
| 🪟 | Spatial UI — declarative panels, flexbox cards, gradients & shadows (uiblocks) |
| 🧱 | Physics — depth-aware Rapier rigid bodies that bounce off the real room |
| 🔊 | Spatial audio & speech — positional sound, recording, speech recognition/synthesis |
| 👥 | Multiplayer — presence, shared objects, and spatial voice (netblocks) |
| 🖥️ | Desktop simulator — develop and test without a headset |
import * as THREE from 'three'; import * as xb from 'xrblocks'; class MainScript extends xb.Script { init() { this.add(new THREE.HemisphereLight(0xffffff, 0x666666, 3)); this.cube = new THREE.Mesh( new THREE.BoxGeometry(0.3, 0.3, 0.3), new THREE.MeshStandardMaterial({color: 0x4285f4}) ); this.cube.position.set(0, xb.user.height - 0.3, -xb.user.objectDistance); this.add(this.cube); } onSelectEnd() { // Pinch in XR, or click in the simulator. this.cube.material.color.set(Math.random() * 0xffffff); } } xb.add(new MainScript()); xb.init(new xb.Options());
| 📦 SDK & source | google/xrblocks · npm i xrblocks |
| 📖 Manual & docs | https://xrblocks.github.io/docs/ |
| 🧪 Templates | https://xrblocks.github.io/docs/templates/Basic/ |
| 🎮 Live samples | https://xrblocks.github.io/docs/samples/ |
| 💎 XR Blocks Gem (vibe-code XR with Gemini) | https://xrblocks.github.io/gem |
- 🌐 Website — https://xrblocks.github.io/
- 📝 Blog — XR Blocks: Accelerating AI + XR Innovation · Vibe Coding XR
- 📄 Papers — White paper (arXiv 2509.25504) · Vibe Coding XR (arXiv 2603.24591)
- 🍿 YouTube — https://www.youtube.com/watch?v=75QJHTsAoB8
We'd love to grow an AI + XR community! 💙
- ⭐ Star google/xrblocks to follow along
- 🐛 File issues for bugs and feature ideas
- 🔧 Open a PR — see
CONTRIBUTING.mdandAGENTS.mdin the main repo (runnpm run lint,npm run format, andnpm testfirst) - 🎨 Build & share a demo — every XR Blocks app is web-standard and instantly shareable via a URL
- 💬 Read the white paper for the roadmap and where we're headed
BibTeX
@misc{Li2025XR, title={{XR Blocks: Accelerating Human-centered AI + XR Innovation}}, author={Li, David and Numan, Nels and Qian, Xun and Chen, Yanhe and Zhou, Zhongyi and others}, year={2025}, eprint={2509.25504}, archivePrefix={arXiv}, primaryClass={cs.HC}, url={https://arxiv.org/abs/2509.25504}, } @misc{Du2026Vibe, title={Vibe Coding XR: Accelerating AI + XR Prototyping with XR Blocks and Gemini}, author={Du, Ruofei and Hersh, Benjamin and Li, David and Numan, Nels and Qian, Xun and others}, year={2026}, eprint={2603.24591}, archivePrefix={arXiv}, primaryClass={cs.HC}, url={https://arxiv.org/abs/2603.24591}, }
Apache-2.0. Powered by WebXR, three.js, Gemini, and LiteRT. ⚡
This is not an officially supported Google product, but is actively maintained by the XR Labs team and external collaborators.