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/props.md.

Props

Props are written in kebab-case in templates (model-data) and camelCase in JavaScript (modelData). The option types (CameraOptions, LightOptions, DirectionalLightOptions, CameraInteractionOptions, Vec3, AnimationData) are exported from vue-vrm.

Model and animation

PropTypeDefaultDescription
model-dataArrayBufferundefinedVRM 1.0 file. A new value replaces the model; undefined unloads it.
animation-dataArrayBuffer | ArrayBuffer[]undefinedVRMA file, or several files to blend. See Animation.
animation-weightsnumber[]undefinedWeight of each clip. Equal weights when omitted or when the length does not match. Must not sum to more than 1.0.
loopbooleantrueRepeats the animation. When false, it plays once and keeps the last frame.
expressionsVrmExpressionsundefinedExpression weights (0–1) keyed by preset or custom name. See Expressions.
auto-blinkboolean | VrmAutoBlinkOptionsfalseBlinks automatically at random intervals. See Expressions.

Canvas

PropTypeDefaultDescription
widthnumber | string480Width in pixels, or a CSS length such as '100%' to follow the parent.
max-widthnumberundefinedUpper limit for the width.
aspect-rationumber3 / 4Width divided by height.
bg-transparentbooleanfalseTransparent background.
bg-imagestringundefinedBackground image URL. Ignored when bg-transparent is set.
show-gridbooleanfalseShows a grid on the floor.
shader-passShaderPassundefinedA three.js ShaderPass applied after rendering.

Rendering

PropTypeDefaultDescription
renderVrmRenderFunctionundefinedCalled every frame instead of the default renderer.render(scene, camera). See below.

When render is set, the component still updates the animation mixer and vrm.update() before calling it, with the same delta. It replaces the default rendering and the built-in shader-pass composer, and it is also used by captureScreenshot(). A new function takes effect from the next frame.

The following example applies an EffectComposer with a custom glitch pass. The composer is created on renderer:ready, resized on resize, and disposed on renderer:dispose (see Events). The renderer, scene, and camera stay the same while models are swapped, so the composer does not need to be rebuilt on model:loaded.

<script setup lang="ts">
  import type { VrmRenderContext, VrmRenderTargets, VrmResizePayload } from 'vue-vrm';
  import { VrmCanvas } from 'vue-vrm';
  import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
  import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
  import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
  import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';

  import { GlitchShader } from './GlitchShader'; // your own ShaderMaterial parameters

  let composer: EffectComposer | undefined;
  let glitchPass: ShaderPass | undefined;

  function onReady({ renderer, scene, camera }: VrmRenderTargets): void {
    composer = new EffectComposer(renderer);
    composer.addPass(new RenderPass(scene, camera));
    glitchPass = new ShaderPass(GlitchShader);
    composer.addPass(glitchPass);
    composer.addPass(new OutputPass());
  }

  function onResize({ width, height, pixelRatio }: VrmResizePayload): void {
    composer?.setPixelRatio(pixelRatio);
    composer?.setSize(width, height);
    glitchPass?.uniforms.uResolution?.value.set(width * pixelRatio, height * pixelRatio);
  }

  function onRender({ delta, elapsed }: VrmRenderContext): void {
    if (!(composer && glitchPass)) return;
    glitchPass.uniforms.uIntensity.value = getBeatIntensity(); // 0–1, e.g. from audio analysis
    glitchPass.uniforms.uTime.value = elapsed;
    composer.render(delta);
  }

  function onDispose(): void {
    composer?.dispose();
    composer = undefined;
    glitchPass = undefined;
  }
</script>

<template>
  <VrmCanvas
    :model-data="modelData"
    :render="onRender"
    @renderer:ready="onReady"
    @resize="onResize"
    @renderer:dispose="onDispose"
  />
</template>

Camera

PropTypeDefaultDescription
camera-optionsCameraOptions{ fov: 30, near: 0.1, far: 100 }Field of view (degrees) and clipping planes.
camera-distancenumberfitted to the modelDistance from the target.
camera-eulerVec3[0, 0, 0]Rotation around the target, in radians.
camera-offsetVec3[0, 0, 0]Moves the target that the camera is placed around.
camera-look-atVec3[0, 0.9, 0]The point the camera looks at. Ignored while orbit controls are enabled.
camera-interactionCameraInteractionOptionsundefinedOrbit controls. See Camera & Lighting.

Lights

PropTypeDefaultDescription
ambient-lightLightOptions{ color: '#ffffff', intensity: 0.5 }Ambient light.
directional-lightDirectionalLightOptions{ color: '#ffffff', intensity: 1, position: [1, 1, 1] }Directional light.

Types

type Vec3 = [number, number, number];

type AnimationData = ArrayBuffer | ArrayBuffer[];

type CameraOptions = { fov?: number; near?: number; far?: number };

type LightOptions = { color: string; intensity: number };

type DirectionalLightOptions = LightOptions & { position: Vec3 };

type CameraInteractionOptions = {
  enabled: boolean;
  rotate?: boolean;
  pan?: boolean;
  zoom?: boolean;
  roll?: boolean;
  rotateSpeed?: number;
  panSpeed?: number;
  zoomSpeed?: number;
  damping?: boolean;
  dampingFactor?: number;
  minDistance?: number;
  maxDistance?: number;
  rollSpeed?: number;
};

type VrmRenderTargets = { renderer: WebGLRenderer; scene: Scene; camera: PerspectiveCamera };

type VrmRenderContext = VrmRenderTargets & { delta: number; elapsed: number };

type VrmRenderFunction = (context: VrmRenderContext) => void;

type VrmExpressions = Partial<Record<VRMExpressionPresetName, number>> & Record<string, number>;

type VrmExpressionNames = { preset: VRMExpressionPresetName[]; custom: string[] };

type VrmAutoBlinkOptions = { interval?: [number, number]; duration?: number };