Socket
Book a DemoInstallSign in
Socket

angular-three

Package Overview
Dependencies
Maintainers
1
Versions
392
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-three

Angular Renderer for THREE.js

latest
Source
npmnpm
Version
4.0.3
Version published
Weekly downloads
1.7K
25.93%
Maintainers
1
Weekly downloads
 
Created
Source

angular-three

A custom Renderer for Angular 20+ that uses Three.js to render 3D scenes.

Documentation

All public APIs are documented with JSDoc comments. Your IDE will provide inline documentation, parameter hints, and examples as you code.

Official Documentation

Please visit Angular Three Documentation

Installation

npm install -D angular-three-plugin
npx ng generate angular-three-plugin:init

Usage

  • Create a SceneGraph component for your 3D scene graph
import { extend } from 'angular-three';
import { Mesh, BoxGeometry } from 'three';

extend({
	Mesh, // makes ngt-mesh available
	BoxGeometry, // makes ngt-box-geometry available
	/* ... */
	MyMesh: Mesh, // makes ngt-my-mesh available
});

// alternatively for demo purposes, you can use the following
// extend(THREE);
// This includes the entire THREE.js namespace

@Component({
	selector: 'app-scene-graph',
	template: `
		<ngt-mesh>
			<ngt-box-geometry />
		</ngt-mesh>
	`,
	schemas: [CUSTOM_ELEMENTS_SCHEMA], // required
	changeDetection: ChangeDetectionStrategy.OnPush,
})
export class SceneGraph {}
  • Render the SceneGraph with NgtCanvas
import { NgtCanvas } from 'angular-three/dom';
import { SceneGraph } from './scene-graph';

@Component({
	// This Component is rendered normally in Angular.
	selector: 'app-my-experience',
	template: `
		<ngt-canvas>
			<app-scene-graph *canvasContent />
		</ngt-canvas>
	`,
	imports: [NgtCanvas],
})
export class MyExperience {}

The Component that renders NgtCanvas (MyExperience in this case) controls the dimensions of the canvas so make sure to style it accordingly.

  • Finally, provide the custom renderer in bootstrapApplication
import { provideNgtRenderer } from 'angular-three/dom';

bootstrapApplication(AppComponent, {
	providers: [provideNgtRenderer()],
});

Keywords

angular

FAQs

Package last updated on 06 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts