npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ngx-3d/viewport

v0.1.34

Published

Three.js integration for Angular

Readme

@ngx-3d/viewport

A powerful Angular library for integrating THREE.js 3D graphics into your Angular applications with ease. Built with Angular 20+ and THREE.js, this library provides a declarative, component-based approach to creating 3D scenes.

🚀 Features

  • Declarative Components: Use Angular components to define 3D elements in your templates
  • Reactive State Management: Built on @ngrx/signals for efficient state updates
  • Animation Support: Easy-to-use animation system for 3D objects
  • Light Management: Simple API for adding and managing lights
  • Model Loading: Support for loading GLTF/GLB 3D models
  • Responsive Rendering: Automatic viewport handling and responsive design
  • TypeScript: Full TypeScript support with type definitions
  • Tree-shakeable: Optimized bundle size with specific THREE.js imports

📦 Installation

npm install @ngx-3d/viewport three
npm install --save-dev @types/three

Or using yarn:

yarn add @ngx-3d/viewport three
yarn add --dev @types/three

Or using pnpm:

pnpm add @ngx-3d/viewport three
pnpm add -D @types/three

🎯 Quick Start

1. Import the provider in your app configuration

import { ApplicationConfig } from '@angular/core';
import { provideN3DViewport } from '@ngx-3d/viewport';

export const appConfig: ApplicationConfig = {
  providers: [
    provideN3DViewport()
  ]
};

2. Use the components in your template

import { Component } from '@angular/core';
import { N3DElementComponent } from '@ngx-3d/viewport';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [N3DElementComponent],
  template: `
    <n3d-element
      [modelPath]="'assets/models/scene.glb'"
      [autoRotate]="true"
      [cameraPosition]="{ x: 0, y: 5, z: 10 }"
    />
  `
})
export class AppComponent {}

📚 Components

N3DElementComponent

The main component for rendering 3D models:

<n3d-element
  [modelPath]="'assets/models/model.glb'"
  [scale]="2"
  [position]="{ x: 0, y: 0, z: 0 }"
  [rotation]="{ x: 0, y: Math.PI / 4, z: 0 }"
  [autoRotate]="true"
  [rotationSpeed]="1"
  [cameraPosition]="{ x: 0, y: 5, z: 10 }"
  [enableZoom]="true"
  [enablePan]="true"
  [lights]="['directional', 'ambient']"
/>

N3DPlaneComponent

Add ground planes and surfaces:

<n3d-plane
  [width]="100"
  [height]="100"
  [color]="0x999999"
  [receiveShadow]="true"
/>

🎨 State Management

Access the reactive state store:

import { inject } from '@angular/core';
import { N3DViewportStore } from '@ngx-3d/viewport';

export class MyComponent {
  store = inject(N3DViewportStore);

  // Access reactive state
  scene = this.store.scene;
  camera = this.store.camera;
  renderer = this.store.renderer;
  
  // Get current values
  currentScene = this.store.scene();
}

🏗️ Development

Building the Library

cd projects/viewport
npm run build

Build artifacts will be placed in dist/ngx-3d-viewport/.

Development Mode

npm run build:watch

Publishing

  1. Build the library:

    npm run build
  2. Navigate to the dist directory:

    cd dist/ngx-3d-viewport
  3. Publish to npm:

    npm publish

📋 Requirements

  • Angular 20.3.0 or higher
  • THREE.js 0.181.0 or higher
  • @types/three (for TypeScript support)
  • TypeScript 5.9.0 or higher

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

MIT License

🔗 Links