{
 "kind": "tool",
 "slug": "matter-js",
 "path": "tools/matter-js/",
 "name": "Matter.js",
 "maker": null,
 "density": "profile",
 "crumbs": [
  [
   "Tools",
   "tools/"
  ],
  [
   "Game development",
   "tools/game-dev/"
  ]
 ],
 "lead": "2D rigid body physics engine for web and game development.",
 "chips": [
  {
   "label": "Game development",
   "path": "tools/game-dev/"
  },
  {
   "label": "NPM"
  }
 ],
 "primary": {
  "label": "Copy install command",
  "copy": "npm install matter-js"
 },
 "links": [
  {
   "label": "GitHub",
   "href": "https://github.com/liabru/matter-js"
  },
  {
   "label": "Website",
   "href": "http://brm.io/matter-js/"
  }
 ],
 "track": "New versions, deprecation and license changes on your dashboard",
 "verdicts": [
  {
   "key": "license",
   "label": "License",
   "value": "MIT",
   "status": "yes",
   "sub": "Use it in paid apps",
   "quote": null,
   "note": "License from npm.",
   "src": "https://github.com/liabru/matter-js"
  },
  {
   "key": "maint",
   "label": "Maintained",
   "value": "Maintained",
   "status": "yes",
   "sub": "Last change Sep 30, 2026",
   "note": "",
   "src": "https://github.com/liabru/matter-js"
  },
  {
   "key": "pop",
   "label": "Used by agents' projects",
   "value": "5 projects",
   "status": "info",
   "sub": "#3 of 8 in its category",
   "note": "Dependency in 5 public GitHub projects set up for AI coding agents that we scanned (0.1%).",
   "src": null
  },
  {
   "key": "agent",
   "label": "Agent access",
   "value": "Install only",
   "status": "info",
   "sub": null,
   "note": "Agent skills for this library in the skills catalog; community skills are written by others, read them before you install.",
   "src": null
  }
 ],
 "vfoot": "From the package registry and GitHub, checked daily.",
 "blocks": [
  {
   "id": "overview",
   "nav": "Overview",
   "h2": "What Matter.js does",
   "parts": [
    {
     "t": "prose",
     "text": "Matter.js is an original JavaScript 2D rigid body engine, not a port, that ships its own canvas renderer and a long list of live demos whose source sits in the repo."
    }
   ]
  },
  {
   "id": "popularity",
   "nav": "Popularity",
   "h2": "Matter.js popularity",
   "parts": [
    {
     "t": "stats",
     "items": [
      {
       "n": "56",
       "of": "/ 100",
       "l": "Gid Score, #1368 overall"
      },
      {
       "n": "586K",
       "l": "downloads a week, npm"
      },
      {
       "n": "18.7K",
       "l": "GitHub stars"
      },
      {
       "n": "5",
       "l": "agent projects use it"
      }
     ]
    },
    {
     "t": "small",
     "text": "Gid Score measures public popularity and activity, not quality.",
     "link": "How the Gid Score is calculated",
     "path": "tools/top/"
    }
   ]
  },
  {
   "id": "usage",
   "nav": "How it is used",
   "h2": "How Matter.js is used",
   "parts": [
    {
     "t": "list",
     "items": [
      "Matter.js is a dependency in 5 of the 6,258 public GitHub projects set up for AI coding agents that we scanned, too few to describe it from them alone. Our scan also samples projects by dependency (Solana 3,067, Ethereum and EVM 1,774, 3D and games 3,130, agent frameworks and SDKs 13,750); counting those, it appears in 34 projects, and what it is used with below comes from all of them.",
      "The most used alternative in our scan is Phaser (12 projects).",
      "Projects that use it most often also use Three.js (73.5%), React Three Fiber (70.6%), React (94.1%)."
     ]
    },
    {
     "t": "h3",
     "text": "Often used with"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "In 73.5% of its projects",
       "v": "Three.js",
       "path": "tools/three/"
      },
      {
       "l": "In 70.6% of its projects",
       "v": "React Three Fiber",
       "path": "tools/react-three/"
      },
      {
       "l": "In 94.1% of its projects",
       "v": "React",
       "path": "tools/react/"
      },
      {
       "l": "In 52.9% of its projects",
       "v": "Framer Motion",
       "path": "tools/framer-motion/"
      },
      {
       "l": "In 52.9% of its projects",
       "v": "GSAP",
       "path": "tools/gsap/"
      },
      {
       "l": "In 50.0% of its projects",
       "v": "React Router",
       "path": "tools/react-router-dom/"
      },
      {
       "l": "In 44.1% of its projects",
       "v": "React Icons",
       "path": "tools/react-icons/"
      },
      {
       "l": "In 67.6% of its projects",
       "v": "Tailwind CSS",
       "path": "tools/tailwindcss/"
      }
     ]
    }
   ]
  },
  {
   "id": "profile",
   "nav": "Profile",
   "h2": "Matter.js in practice",
   "parts": [
    {
     "t": "h3",
     "text": "Strengths"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Its own physics code, not a port",
       "v": "The README lists the engine as \"An original JavaScript physics implementation (not a port)\". The API is written for JavaScript from the start, not translated from another engine."
      },
      {
       "l": "Browser and Node.js from one package",
       "v": "The feature list claims support for Chrome, Firefox, Safari and IE8+, plus Node.js. It also lists touch input and responsive layouts for mobile."
      },
      {
       "l": "More than boxes and circles",
       "v": "The feature list covers compound and composite bodies and concave and convex hulls. There is a demo that builds bodies from concave SVG paths."
      },
      {
       "l": "Raycasting, views and slow motion included",
       "v": "Collision queries (raycasting and region tests), camera-like views with translate and zoom, and time scaling are all part of the core feature list."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Watch out for"
    },
    {
     "t": "rows",
     "rows": [
      {
       "l": "Dev-mode tooling can slow the simulation",
       "v": "The README warns that bundlers and frameworks may reduce real-time performance with their default configs, especially in development modes."
      },
      {
       "l": "Webpack sourcemaps and Vue watchers",
       "v": "The README names two specific culprits: Webpack's default sourcemap config and Vue.js watchers. It points to GitHub issue #1001 for fixes, not to a setting in the library itself."
      },
      {
       "l": "Saving world state needs another library",
       "v": "World state serialisation is listed as a feature, but it requires the separate resurrect.js project."
      }
     ]
    },
    {
     "t": "h3",
     "text": "Install from npm"
    },
    {
     "t": "tabs",
     "label": "Example",
     "items": [
      {
       "tab": "Bash",
       "code": "npm install matter-js"
      }
     ]
    }
   ]
  },
  {
   "id": "more",
   "nav": null,
   "spy_as": "profile",
   "h2": "More about Matter.js",
   "parts": [
    {
     "t": "more",
     "items": [
      {
       "title": "Packages around it",
       "items": [
        "three: 3D rendering",
        "@react-three: Three.js in React",
        "react: UI library",
        "framer-motion: React animation",
        "react-router-dom: Client routing",
        "gsap: Tween animation"
       ]
      },
      {
       "title": "More in Game development",
       "path": "tools/game-dev/",
       "items": [
        {
         "text": "Pygame",
         "path": "tools/pygame/"
        },
        {
         "text": "chess.js",
         "path": "tools/chess-js/"
        },
        {
         "text": "phaser3-rex-plugins",
         "path": "tools/phaser3-rex-plugins/"
        },
        {
         "text": "Colyseus",
         "path": "tools/colyseus/"
        },
        {
         "text": "pyglet",
         "path": "tools/pyglet/"
        },
        {
         "text": "PyBullet",
         "path": "tools/pybullet/"
        }
       ]
      }
     ]
    }
   ]
  },
  {
   "id": "alternatives",
   "nav": "Alternatives",
   "h2": "Alternatives",
   "parts": [
    {
     "t": "alts",
     "items": [
      {
       "name": "Matter.js",
       "me": true,
       "facts": [
        "MIT",
        "Gid 56",
        "586K/wk"
       ]
      },
      {
       "name": "Phaser",
       "why": "Fast, free HTML5 game framework for building 2D games for desktop and mobile.",
       "path": "tools/phaser/",
       "facts": [
        "MIT",
        "Gid 71",
        "778K/wk"
       ]
      }
     ],
     "more": "Compare Matter.js with another tool",
     "more_path": "tools/compare/"
    }
   ]
  },
  {
   "id": "start",
   "nav": "Get started",
   "h2": "Get started",
   "parts": [
    {
     "t": "install",
     "intro": "Install it.",
     "code": "npm install matter-js"
    },
    {
     "t": "h3",
     "text": "Rules for your agent"
    },
    {
     "t": "rules",
     "label": "Paste into AGENTS.md or CLAUDE.md",
     "text": "## Matter.js\n- Install with `npm install matter-js`. If you load it with a script tag, use a stable release from the tags, not the experimental alpha build on master.\n- Start from the Getting started wiki page. Its minimal example is meant to run in both browsers and Node.js.\n- When the project has its own game or render loop, follow the Running and Rendering wiki pages instead of assuming the built-in canvas renderer.\n- If the simulation stutters in development, check the bundler before the physics. Webpack's default sourcemap config and Vue.js watchers are known causes (see issue #1001).\n- World state serialisation needs resurrect.js. Add it explicitly before saving or restoring worlds.\n- Before writing a feature from scratch, look for the matching demo in the repo's `examples` directory, then for a plugin in the wiki's List of plugins.\n"
    }
   ]
  }
 ],
 "glance": [
  [
   "Package",
   "npm matter-js"
  ],
  [
   "Category",
   "Game development"
  ],
  [
   "License",
   "MIT"
  ],
  [
   "Latest version",
   "0.20.0, June 23, 2024"
  ],
  [
   "On GitHub since",
   "February 2014"
  ],
  [
   "Gid Score",
   "55.9"
  ],
  [
   "Rank in category",
   "#3 of 8"
  ],
  [
   "GitHub",
   "liabru/matter-js"
  ],
  [
   "Last change",
   "Sep 30, 2026"
  ]
 ],
 "good": [
  "Used by Patrick Heng, Nice and Serious (USELESS), Goodness (Secret 7), New Company, as listed by the source; we have not checked each one."
 ],
 "checked_line": "From the package registry, GitHub and our scan of public agent projects; numbers update daily.",
 "logo": "https://agentgid.com/media/avatars/liabru.png"
}