API
PlayCanvas React provides a declarative, component-based API for building 3D applications. The API is organized into core components, engine components and hooks.
Core
<Application/>- Root component that initializes the PlayCanvas engine and provides a rendering context<Entity/>- Fundamental scene graph building block with position, rotation and scale<Gltf/>- Load and instantiate GLB/GLTF scenes<Modify.*>- Declaratively modify entities and components inside an imported GLB
Components
Components add behavior to entities. Nest them inside an <Entity/> to attach the corresponding PlayCanvas component.
<Anim/>- State-based animation<Align/>- Alignment helper<Camera/>- Camera and viewport<Collision/>- Physics collision shapes<Environment/>- Scene environment and skybox<GSplat/>- Gaussian splat rendering<Light/>- Directional, point and spot lights<Render/>- Mesh rendering (primitives and assets)<Rigidbody/>- Physics rigid bodies<Script/>- Custom script components
Hooks
React hooks for integrating with the PlayCanvas engine lifecycle. See the Hooks overview for usage patterns and best practices.
- useApp - Access the PlayCanvas Application instance
- useParent - Get the parent Entity from context
- useAsset - Load any type of PlayCanvas asset
- useAppEvent - Subscribe to application events
- useMaterial - Create and manage materials
- usePhysics - Access physics context and state