whatisgithub

What is gltfjsx?

pmndrs/gltfjsx — explained in plain English

Analysis updated 2026-06-26

5,790JavaScriptAudience · vibe coderComplexity · 3/5Setup · easy

In one sentence

Turn any 3D model file (GLTF/GLB) into a reusable React component, with named parts, animations, and optional 70-90% file-size compression built in.

Mindmap

mindmap
  root((gltfjsx))
    What it does
      Converts 3D models
      Generates JSX components
      Names every model part
    Optimization
      Draco compression
      WebP texture resize
      Removes redundant data
    React Features
      Reuse models freely
      Swap materials easily
      Animation hooks
    Tech Stack
      GLTF GLB format
      react-three-fiber
      TypeScript support
    Use Cases
      3D web scenes
      Interactive products
      Animated characters
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add an interactive 3D product model to a React website where users can click individual parts to highlight or inspect them.

USE CASE 2

Compress a heavy 3D character file by up to 90% before shipping it in a web app, without touching the original.

USE CASE 3

Reuse the same 3D scene object multiple times on a page without conflicts or duplicated data.

USE CASE 4

Wire up 3D model animations to React state so you can trigger walk, idle, or jump clips from your UI.

What is it built with?

JavaScriptReactreact-three-fiberGLTF/GLBDracoWebPTypeScriptNode.js

How does it compare?

pmndrs/gltfjsxairbnb/hypernovapdfcrafttool/pdfcraft
Stars5,7905,7945,784
LanguageJavaScriptJavaScriptJavaScript
Setup difficultyeasyhardeasy
Complexity3/54/51/5
Audiencevibe coderdevelopergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Run with npx, no global install needed. Requires an existing react-three-fiber project. Use --transform flag for compression.

Open source from the Poimandres collective, free to use in personal and commercial projects.

So what is it?

gltfjsx is a command-line tool that takes a 3D model file in the GLTF or GLB format and converts it into a React component. GLTF is a standard file format for 3D scenes and models, and react-three-fiber is a library for displaying 3D content inside React applications. The problem gltfjsx solves is that dropping a raw GLTF file into a 3D scene is inflexible: you can only place the model once, you have to dig through its internal structure to change anything, and modifying parts of it tends to corrupt the original data. When you run gltfjsx on a model, it reads the file, maps out all the meshes, materials, lights, cameras, and animations inside it, and produces a JSX file where each part of the model is a named element. That means you can place the same model multiple times in a scene without conflicts, hide or show individual parts based on conditions, change colors or swap out materials with a single line, and attach click or hover events to specific pieces of the model. The tool also handles optimization. With the --transform flag it runs the model through a compression pipeline that typically reduces file size by 70 to 90 percent, handling draco compression for geometry, resizing textures to 1024x1024 in WebP format, and removing redundant data. It does not alter the original file, it produces a separate transformed copy. Additional options include TypeScript type generation for the model's nodes and materials, auto-instancing to reduce rendering cost when the same geometry appears multiple times, and automatic wiring of animation clips into hooks so you can trigger and blend them from your React code. The tool is run with npx and does not require a global install. It is part of the pmndrs (Poimandres) open source collective, which also maintains react-three-fiber and related libraries.

Copy-paste prompts

Prompt 1
I have a GLB file of a product and I want to display it in my React app using react-three-fiber. How do I run gltfjsx on it, and what do I do with the JSX file it outputs?
Prompt 2
Using the gltfjsx-generated component for my 3D model, write React code that hides one named mesh when a button is clicked and changes another mesh's color on hover.
Prompt 3
I ran gltfjsx with --transform and got a compressed model. Walk me through adding the transformed GLB to a Next.js project and rendering it with react-three-fiber.
Prompt 4
Show me how to use the animation hooks that gltfjsx generates to play and blend two animation clips, for example switching between an idle and a walk cycle based on React state.
Prompt 5
I want TypeScript types for my gltfjsx component so I get autocomplete on the model nodes and materials. How do I generate them and use them in my component?

Frequently asked questions

What is gltfjsx?

Turn any 3D model file (GLTF/GLB) into a reusable React component, with named parts, animations, and optional 70-90% file-size compression built in.

What language is gltfjsx written in?

Mainly JavaScript. The stack also includes JavaScript, React, react-three-fiber.

What license does gltfjsx use?

Open source from the Poimandres collective, free to use in personal and commercial projects.

How hard is gltfjsx to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is gltfjsx for?

Mainly vibe coder.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.