---
title: useLoader
description: useLoader is a composable for loading 3D assets and textures with Three.js loaders, supporting progress tracking and reactivity.
---
The `useLoader` composable provides a reactive and easy-to-use method for loading 3D models and textures with any Three.js loader. It supports progress tracking, error handling, and works seamlessly with Vue's reactivity system. This makes it ideal for loading assets in TresJS scenes, including GLTF, FBX, textures, and more.
## Usage
### Loading a Texture and Applying to a Mesh
::examples-use-loader-texture
::
```vue [TextureExample.vue]
```
### Loading a GLTF Model and Rendering a Named Node
::examples-use-loader-gltf
::
```vue [GLTFExample.vue]
```
### Loading an FBX Model and Rendering It
```vue [FBXExample.vue]
```
## API
The `useLoader` composable returns a reactive object with the following properties:
:::field-group
::::field{name="state" type="Ref"}
The loaded asset (model, texture, etc.), or `null` if not loaded yet.
::::
::::field{name="isLoading" type="Ref"}
Indicates if the asset is currently loading.
::::
::::field{name="error" type="Ref"}
Any error encountered during loading.
::::
::::field{name="progress" type="{ loaded: number; total: number; percentage: number }"}
Progress information for the current load operation.
::::
::::field{name="load" type="(path: string) => void"}
Method to load a new asset from a different path.
::::
:::
### Type Signature
```ts [Signature]
function useLoader(
Loader: LoaderProto,
path: MaybeRef,
options?: TresLoaderOptions,
): UseLoaderReturn
```
## Tips & Best Practices
- **Always use the correct loader for your asset type** (e.g., `GLTFLoader` for `.glb/.gltf`, `FBXLoader` for `.fbx`, `TextureLoader` for images).
- **Track loading progress** using the `progress` object to show user feedback.
- **Use a `LoadingManager`** for global progress tracking across multiple assets.
- **Handle errors** by watching the `error` ref and providing fallback UI.
- **Reactive paths:** You can pass a `ref` as the path to automatically reload when the path changes.
::note
If you need to load multiple assets at once, create multiple `useLoader` instances or use a `LoadingManager` to coordinate progress.
::