For AI agents: the complete documentation index is available at /vue-vrm/llms.txt, the full documentation bundle is available at /vue-vrm/llms-full.txt, and this page is available as Markdown at /vue-vrm/api/events.md.

Events

Model

EventPayloadEmitted when
model:loading—A model starts loading.
model:loadedVRMThe model has been loaded and added to the scene.
model:unloaded—The previous model has been removed.
model:errorErrorThe buffer is not a valid VRM 1.0 file, or loading failed.

Animation

EventPayloadEmitted when
animation:loading—Animation data starts loading.
animation:loadedVRMAnimation | VRMAnimation[]The animation has been loaded.
animation:start—Playback started.
animation:pause—pauseAnimation() was called.
animation:resume—resumeAnimation() was called.
animation:stop—stopAnimation() was called.
animation:end—A non-looping animation reached its end.
animation:errorErrorThe buffer is not a valid VRMA file, the weights sum to more than 1.0, or loading failed.

Camera and lights

EventPayloadEmitted when
camera:change{ position: Vector3; lookAt: Vector3; distance: number }The camera position or target changed.
camera:options-changeRequired<CameraOptions>camera-options changed.
light:ambient-changeLightOptionsambient-light changed.
light:directional-changeLightOptions & { position: Vector3 }directional-light changed.

Rendering

EventPayloadEmitted when
renderer:readyVrmRenderTargetsOn mount, once the renderer, scene, and camera exist, before the first frame and the first resize.
resize{ width: number; height: number; pixelRatio: number }After the renderer and camera have been resized. Also emitted once on mount.
renderer:dispose—On unmount, before the renderer is disposed.

Use these events with the render prop to manage custom postprocessing. renderer:ready is not emitted when WebGL is unavailable (an error event is emitted instead).

Other

EventPayloadEmitted when
errorErrorAny other failure, such as a background image that cannot be loaded or a browser without WebGL.
<script setup lang="ts">
  import type { VRM } from '@pixiv/three-vrm';
  import { VrmCanvas } from 'vue-vrm';

  function onLoaded(vrm: VRM): void {
    console.log(vrm.meta.name);
  }
</script>

<template>
  <VrmCanvas :model-data="modelData" @model:loaded="onLoaded" @error="console.error" />
</template>

When the component is used as a Web Component, these are dispatched as native CustomEvents with the same names, and the payload is available as event.detail[0].