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.
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>
);
}