The T namespace contains components that wrap three.js objects, allowing you to insert them into your scene declaratively. You create the namespace using the createT() factory function:
import { createT } from "solid-three"import * as THREE from "three"
// Create T namespace with all three.js objectsconst T = createT(THREE)
// Now you can use T components<T.Mesh> <T.BoxGeometry args={[1, 1, 1]} /> <T.MeshBasicMaterial color="hotpink" /></T.Mesh>You can also create a namespace with specific objects for tree-shaking purposes:
import { createT } from "solid-three"import { Mesh, BoxGeometry, MeshBasicMaterial } from "three"
// Create T namespace with only specific objectsconst T = createT({ Mesh, BoxGeometry, MeshBasicMaterial })Usage patterns
- In applications — create a single
Tand export it for use throughout your app. - In libraries — create scoped
Tnamespaces for tree-shaking, or use<Entity/>instead. - Multiple namespaces — create several
Tinstances to lazy-load different parts of three.js.
See also
<Entity/>— the namespace-free form, pluscreateEntityfor a single typed component.useProps— how props on every<T.*>component are applied.
Last updated: 6/8/26, 11:20 AM