three-live
v1.5.1
Published
Lightweight 3D, WebXR, and procedural Three.js runtime
Maintainers
Readme
three-live
Lightweight <three-live> web component for 3D, AR, and sandboxed procedural
Three.js. Part of Three-Live.
Status: Beta. Minor API details may evolve before General Availability (GA).
Install
npm install three-liveOr load it from a CDN with a classic script tag:
<script src="https://cdn.jsdelivr.net/npm/three-live/dist/three-live.min.js"></script>Usage
<three-live capabilities="scripts camera external_handoff" camera-controls ar>
<script type="text/three">
scene.add(new THREE.Mesh(
new THREE.TorusKnotGeometry(0.4, 0.14, 64, 16),
new THREE.MeshStandardMaterial({color: 0x4285f4, metalness: 0.6, roughness: 0.2})
));
</script>
</three-live>All sensitive capabilities (scripts, network, remote_content, camera,
microphone, sensors, storage, ai, external_handoff) default to off.
Inline scripts run in a sandboxed worker and require capabilities="scripts"
(or legacy allow-client-scripts). To display remote models only, use the
viewer-only build with capabilities="viewer":
<script src="https://cdn.jsdelivr.net/npm/three-live/dist/three-live-viewer.min.js"></script>
<three-live capabilities="viewer" src="model.glb" camera-controls auto-rotate></three-live>Bundles
| File | Contents |
| :--- | :--- |
| dist/three-live-viewer.min.js | Viewer only: .glb display, PBR, orbit controls, animation |
| dist/three-live.min.js | Standard: viewer + sandboxed <script type="text/three"> + AR handoff |
| dist/three-live-studio.min.js | Add-on: PBR Next, HDRI/SH, bloom/outline, KHR_materials_variants, EXT_meshopt_compression, KHR_interactivity VM, lod (THREE.LOD / MSFT_lod), hotspots |
| dist/three-live-cad.min.js | Add-on: 2D Path/Shape, ExtrudeGeometry, SweepGeometry, HelixGeometry, LoftGeometry, PatternInstancer, 3D CSG Booleans, stroke-font TextGeometry |
| dist/three-live-procedural.min.js | Add-on: Box3/Sphere, CanvasTexture, Noise, ProceduralTexture, Sprite, 2D curves, scene helpers |
| dist/three-live-animation.min.js | Add-on: 64-joint skinning, morph targets, keyframe cross-fading, 2-bone/FABRIK IKSolver |
| dist/three-live-ai.min.js | Add-on: bring-your-own-LLM scene editing (editScene(), undoEdit()) & Tap & Speak voice |
| dist/three-live-webgpu.min.js | Add-on: WebGPU GPURenderBundle scene accelerator (renderer="auto\|webgpu\|webgl2") |
| dist/three-live-full.min.js | Standard + all plugins (studio, cad, procedural, animation, ai, webgpu) |
ES module and CommonJS builds are available through the package exports.
Documentation
See the project README and docs.
License
Apache 2.0. This is not an officially supported Google product.
