Skip to main content
mujoco-react uses TypeScript declaration merging for model resource names. The recommended workflow is to let the Vite plugin scan your model files and write a checked-in generated type artifact.

Vite Plugin

The plugin writes src/mujoco-register.gen.ts during dev and build. Commit it. Vite auto-loads this file, so application code imports generated values from mujoco-react, not from the generated file:
The package exports are then typed and populated:

Per-Model Helpers

The global unions keep existing hooks ergonomic. For reusable model-specific controllers, use generated resource values:
This keeps a Franka controller from accidentally depending on resources that are not part of the configured model. Generic helpers like ModelActuators<"franka"> are still available for reusable library code.

Multiple Models

Add more entries to models when an app ships multiple models. Names from all configured models are merged into the global Register unions, while Register.models keeps package exports such as ModelActuators.franka.gripper scoped to the right model.

CLI Fallback

Use the CLI for non-Vite projects or one-off generation:
Legacy alias:

Options