use-vrm
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

useVRM

The useVRM hook for displaying VRM models. Powered by react-three-fiber and pixiv/three-vrm

[!NOTE] Semantic Versioning may not be followed for 0.x releases until reaching a stable state.

Usage

import { Suspense } from "react";
import { useVRM } from "use-vrm";

function Model() {
  const { vrm } = useVRM("./example.vrm", "./idle.vrma");

  // loading is handled via suspend-react
  return <primitive object={vrm.scene} />;
}

function App() {
  return (
    <Suspense fallback={<FallbackComponent /> /* or null */}>
      <Model />
    </Suspense>
  );
}

Example

Open in StackBlitz

Readme

Keywords

Package Sidebar

Install

npm i use-vrm

Weekly Downloads

6

Version

0.0.3

License

Apache-2.0

Unpacked Size

8.99 kB

Total Files

6

Last publish

Collaborators

  • __yue__