Introduction
vue-vrm is a Vue 3 component for rendering VRM avatars with three.js. It loads VRM 1.0 models and plays VRMA animations through three-vrm.
The component sets up the renderer, scene, lights, camera, and render loop for you. Common settings are props, and the underlying three.js objects stay available through a template ref.
Unless you hold the copyright to the model and all of its assets (textures and so on), do not implement code that loads the actual file directly — for example from a public URL or from a file bundled with your app. See Examples for how to deliver files safely.
Features
- VRM 1.0 rendering with three-vrm's MToon shader.
- VRMA playback of one or more clips, with blend weights and playback control.
- Camera and lighting props, automatic framing, and optional orbit controls with roll.
- Background, grid, and postprocessing options.
- Events for loading, animation, camera, and light changes.
- Instance API to control playback, take screenshots, and access three.js objects.
- Helper functions to validate and load VRM / VRMA buffers without the component.
- Web Component build of the same component.
Why ArrayBuffer only
The component accepts model and animation data only as ArrayBuffer, not as file paths or URLs.
Many VRM models are distributed under licenses that forbid redistribution. If a model is referenced by URL, the file appears in your source code, source maps, and the browser's network log, where anyone can download it. Passing an ArrayBuffer keeps that decision in your application: you can read a user's local file, or fetch the bytes from an API that checks who is asking.
Store model files in object storage such as Amazon S3 or Cloudflare R2, or fetch them through the VRoid Hub API. See Examples for working server code.
Supported environments
vue, three, @pixiv/three-vrm, and @pixiv/three-vrm-animation are peer dependencies.
Next steps
- Getting Started — install the package and render your first model.
- Playground — try the live demo.
- Props — the full list of options.