@thinkersteps_labs/3d-viewer-angular
v3.0.6
Published
Readme
@thinkersteps_labs/3d-viewer-angular
Official Angular component wrapper for @thinkersteps_labs/3d-viewer-core. Renders photorealistic 3D jewelry and customizer canvases in Angular 18+ applications (including standalone components and legacy NgModule architectures).
Installation
pnpm add @thinkersteps_labs/3d-viewer-angular @thinkersteps_labs/3d-viewer-core three
# or with npm
npm install @thinkersteps_labs/3d-viewer-angular @thinkersteps_labs/3d-viewer-core threePeer Dependencies: Requires
@angular/core >= 18.0.0andthree >= 0.150.0.
1. Turnkey Customizer (<td-jewelry-customizer>)
import { Component } from '@angular/core'
import { JewelryCustomizerComponent } from '@thinkersteps_labs/3d-viewer-angular'
@Component({
selector: 'app-product-page',
standalone: true,
imports: [JewelryCustomizerComponent],
template: `
<td-jewelry-customizer
[src]="'https://cdn.example.com/models/solitaire-ring.glb'"
[(metal)]="activeMetal"
[(stone)]="activeStone"
[height]="520"
[autoRotate]="true"
></td-jewelry-customizer>
`
})
export class ProductPageComponent {
activeMetal = 'rmj-custom-yellow-gold'
activeStone = 'rmj-diamond-d-colorless'
}2. Composable Primitives (<td-viewer> + Swatches)
import { Component } from '@angular/core'
import {
ViewerComponent,
MetalSwatchesComponent,
StoneSwatchesComponent,
type MetalColorProp,
type StoneColorProp,
} from '@thinkersteps_labs/3d-viewer-angular'
@Component({
selector: 'app-product-detail',
standalone: true,
imports: [ViewerComponent, MetalSwatchesComponent, StoneSwatchesComponent],
template: `
<div style="max-width: 840px; margin: 0 auto;">
<td-viewer
[src]="modelUrl"
[metalColor]="activeMetal"
[stoneColor]="activeStone"
[height]="500"
[autoRotate]="true"
></td-viewer>
<div style="margin-top: 16px; display: flex; flex-direction: column; gap: 14px;">
<td-metal-swatches [(value)]="activeMetal" [variant]="'pills'"></td-metal-swatches>
<td-stone-swatches [(value)]="activeStone" [variant]="'pills'"></td-stone-swatches>
</div>
</div>
`
})
export class ProductDetailComponent {
modelUrl = 'https://cdn.example.com/models/solitaire-ring.glb'
activeMetal: MetalColorProp = 'rmj-custom-yellow-gold'
activeStone: StoneColorProp = 'rmj-diamond-d-colorless'
}3. NgModule Apps (e.g. Angular ERP)
Import ViewerModule in your feature module to get access to <td-viewer>, <td-metal-swatches>, <td-stone-swatches>, and <td-jewelry-customizer>:
import { NgModule } from '@angular/core'
import { ViewerModule } from '@thinkersteps_labs/3d-viewer-angular'
@NgModule({
imports: [ViewerModule],
})
export class ProductModule {}License
MIT
