TypeGPU Kit is a set of GPU modules on TypeGPU, for the web and React Native. It covers rendering, post-processing, particles, text and simulation. Use the modules you want and write the rest yourself. A module borrows your TypeGPU root and records into the encoder or pass you give it. You own the loop, the canvas and the pass order, and each frame ends in one submit.
import { tgpu } from 'typegpu';
import { bloom, frames, finish, targets } from '@typegpu/kit';
import * as web from '@typegpu/kit/web';
const root = await tgpu.init();
const surface = web.surface(root, document.querySelector('canvas')!);
const screen = targets.create(root, surface, { hdr: { format: 'rgba16float', sampled: true } });
const source = () => screen.textures.hdr;
const glow = bloom.create(root, { source });
const final = finish.create(root, { format: surface.format, source, glow });
frames.animate(
frames.create(root, (frame) => {
screen.fit();
const scene = frame.encoder.beginRenderPass({ colorAttachments: { view: screen.views.hdr } });
// the scene, in linear colour
scene.end();
glow.record(frame);
final.record(frame, surface.view(frame));
}),
);Start a new Vite project with the kit, the TypeGPU plugin and one of four starter scenes:
npm create @typegpu/kit my-sceneOr add the kit to a project you have:
pnpm add @typegpu/kit typegpu @typegpu/noise @typegpu/color
pnpm add -D vite unplugin-typegpu typescript@npm:tsover@6.0.2 @webgpu/typestsover, TypeGPU's fork of TypeScript, is optional. It type-checks vector operators such as a * b
in your 'use gpu' functions. With plain TypeScript, write them as functions, such as
std.mul(a, b). The web entries need neither tsover nor React.
Setting up a project covers the bundler plugin and React Native.
You make modules once, at setup, from your root. Each frame, the loop hands its encoder to the modules you call, in the order you call them. The fish tank's frame records one compute pass, a copy when it reads the bites back, and 14 render passes: the shadow, the scene, 11 for bloom and the final pass. Then it submits once.
- Frame: a frame loop, clocks with fixed steps and springs, coroutines, pipeline warm-up, helpers for writing modules and an owner that frees what a scene made.
- Passes and targets: scene passes, last-frame history, render targets that resize together, textures baked from a shader function, mip chains, cameras and shared bind groups.
- Data on the GPU: tables of rows, live lists, state machines, a neighbour grid, workgroup reduce and scan, and a radix sort.
- Reading back: buffer readback, event counters, a picker and dynamic resolution.
- Rendering: shapes, a mesh pool that holds them and glTF models, instances, impostors, skinned poses, lines with joins, caps and dashes, lighting with a sun, sky, fog, point lights and shadows, environment light, physically based shading and materials, and ambient occlusion.
- Post-processing: bloom, auto exposure, FXAA, TAA, depth of field, and a final pass with tone curves, grading, a vignette and dither.
- Particles and text: particles with your own update and shading, trails, and MSDF text from fonts you bake at build time, laid out in JavaScript.
- Assets: a glTF reader with skins and animation clips, images from files, pixels or Radiance HDR, and camera and video frames.
- Hosts: web and React Native canvases, scene files hosted on either, and scenes on a worklet
runtime with
useScene. - Tools: a recording root for tests without a GPU, Dawn tests, GPU timers, a pipeline census and a GPU debug panel for any WebGPU page.
The module map shows every module by area.
Every example opens full-screen, with a
Profile button for the GPU debug panel, and its source is in packages/typegpu-kit-examples/src.
The same examples run on an iPhone in the Expo app in
apps/typegpu-kit-native.
Tutorials build an example from an empty canvas, starting with Slime mould. Write a module builds a module of your own. Recipes combine modules for one job. The docs list them all.
The package ships a skill for coding agents at
node_modules/@typegpu/kit/skills/typegpu-kit/SKILL.md. It holds the kit's rules and an index of
every module, linked to the docs pages that ship as Markdown in the package's docs/. TypeGPU ships
its own skill at node_modules/typegpu/skills/typegpu/SKILL.md. Install both with
pnpm dlx @tanstack/intent@latest install, or name both in your own AGENTS.md. The site serves
each page as Markdown too, listed in
llms.txt.
pnpm install
pnpm dev # docs and examples, in a WebGPU browser
pnpm dev:host # the same over LAN HTTPS, for WebGPU on a phone
pnpm test # types, lint, format, unit and GPU tests, then the docs buildpackages/typegpu-kit:@typegpu/kit.src/geometry: TypeGPU's geometry, public at@typegpu/kit/geometry. Edit it only as its README says.src/sort: TypeGPU's radix sort, which onlysorterimports. Edit it only as its README says.
packages/typegpu-create-kit:@typegpu/create-kit, whichnpm create @typegpu/kitruns, and its starter scenes.packages/typegpu-kit-pull: the box and card animation the docs and the native app share.packages/typegpu-kit-examples: the examples, shared by the docs and the native app.apps/typegpu-kit-docs: the docs, and the host that runs every example page.apps/typegpu-kit-native: an Expo app that runs the examples on an iPhone.
Join the Software Mansion Community Discord to chat about TypeGPU Kit, TypeGPU and other Software Mansion libraries.
Since 2012 Software Mansion is a software agency with experience in building web and mobile apps. We are Core React Native Contributors and experts in dealing with all kinds of React Native issues. We can help you build your next dream product – Hire us.




