Repolode
pmndrs

pmndrs/react-three-rapier

React bindings for the Rapier WASM physics engine, integrating rigid bodies, colliders and joints into react-three-fiber scenes.

Stars
1,475
Forks
89
Open issues
55
Last commit
8 days ago

What is it?

react-three/rapier wraps the Rapier WASM physics engine in React components so that physics objects can be declared alongside meshes in a react-three-fiber scene. A Physics component creates the simulation, RigidBody components attach meshes to it, and collider components define shapes by hand or generate them automatically from mesh geometry.

Beyond basic bodies, the library exposes hooks for fixed, spherical, revolute, prismatic, rope and spring joints, plus instanced rigid bodies for large numbers of meshes. Collision and contact-force events, sensors, collision group filtering, configurable time steps, a debug renderer, independent update loops for on-demand rendering, and world snapshots are also covered.

The package targets react-three-fiber v9 and React 19 in its v2 release; projects on React 18 are directed to v1 with fiber v8.

Key features

  • 01Declarative RigidBody and collider components for react-three-fiber scenes.
  • 02Automatic collider generation from mesh bounds, spheres, or convex hull and trimesh geometry.
  • 03Six joint types exposed as React hooks, including revolute, prismatic and spring joints.
  • 04Instanced rigid bodies with per-instance colliders and compound shapes.
  • 05Collision, sensor and contact-force event callbacks, plus collision group filtering.
  • 06Debug visualization, configurable time step, and world snapshot serialization.

Use cases

  • Adding physics-driven objects such as falling props or bouncing balls to a react-three-fiber game or interactive scene.
  • Building ragdolls, chains, doors or wheels with joints inside a 3D React application.
  • Simulating thousands of small rigid bodies using instanced meshes.
  • Detecting zones or triggers in a 3D scene with sensor colliders.

Quick start

  1. 1

    Install the package from npm

    npm install @react-three/rapier
  2. 2

    Import Physics and RigidBody and wrap your scene in Physics inside Suspense

Things to know

  • Version 2 requires @react-three/fiber v9 and React v19; React v18 users must use v1 with fiber v8.

Topics

FAQ

What is react-three-rapier?
React bindings for the Rapier WASM physics engine, integrating rigid bodies, colliders and joints into react-three-fiber scenes. react-three/rapier wraps the Rapier WASM physics engine in React components so that physics objects can be declared alongside meshes in a react-three-fiber scene. A Physics component creates the simulation, RigidBody components attach meshes to it, and collider components define shapes by hand or generate them automatically from mesh geometry.
Is react-three-rapier free to use? What license does it have?
react-three-rapier is open source under the MIT license. Check the license terms before using it in commercial products.
Is react-three-rapier still maintained?
Actively maintained. The last commit to react-three-rapier was on Oct 12, 2026.
What can I use react-three-rapier for?
Adding physics-driven objects such as falling props or bouncing balls to a react-three-fiber game or interactive scene. Building ragdolls, chains, doors or wheels with joints inside a 3D React application. Simulating thousands of small rigid bodies using instanced meshes. Detecting zones or triggers in a 3D scene with sensor colliders.
How do I install react-three-rapier?
Install the package from npm: npm install @react-three/rapier Import Physics and RigidBody and wrap your scene in Physics inside Suspense
Where can I get react-three-rapier?
The source code and installation instructions are on GitHub: https://github.com/pmndrs/react-three-rapier

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects