🚀 Big News:Socket Has Acquired Secure Annex.Learn More →
Socket
Book a DemoSign in
Socket

ngx-dom-confetti

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-dom-confetti

[Dom Confetti](https://www.npmjs.com/package/dom-confetti) for Angular

latest
npmnpm
Version
0.6.0
Version published
Weekly downloads
29
-6.45%
Maintainers
1
Weekly downloads
 
Created
Source

Ngx Dom Confetti

Dom Confetti for Angular

Install

for npm user

npm install ngx-dom-confetti

for yarn user

yarn add ngx-dom-confetti

for pnpm user

pnpm install ngx-dom-confetti

Use

import NgxDomConfettiModule to AppModule

import { NgxDomConfettiModule } from 'ngx-dom-confetti';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    BrowserAnimationsModule,

    NgxDomConfettiModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

use ngx-dom-confetti

component:

<button mat-raised-button color="primary">
  <ngx-dom-confetti>
    Hit Me!
  </ngx-dom-confetti>
</button>

service

@Component({
  selector: 'app-root',
  template: `
     <div class="center">
      <button #btn="matButton" mat-raised-button color="primary" (click)="hitWithService()">
        Hit Me with Service!
      </button>
    </div>
  `,
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  ngxDomConfettiService: NgxDomConfettiService = inject(NgxDomConfettiService);

  @ViewChild('btn', { read: ElementRef })
  btn!: ElementRef<HTMLButtonElement>;

  hitWithService() {
    const el = this.btn.nativeElement.children.item(0) as HTMLElement;
    if (el) {
      this.ngxDomConfettiService.open(el,this.config);
    }

  }
}

directive

@Component({
  selector: 'app-root',
  template: `
     <div class="center">
      <button mat-raised-button color="primary" (click)="hitWithDirective()">
        Hit Me with Directive!
      </button>
    </div>
  `,
  styleUrls: ['./app.component.scss']
})
export class AppComponent {

  ngxDomConfettiService: NgxDomConfettiService = inject(NgxDomConfettiService);

  @ViewChild(NgxConfettiDirective) confettiDirective!: NgxConfettiDirective;

  hitWithDirective() {
    this.confettiDirective?.launch();
  }
}

license

MIT

Keywords

dom-confetti

FAQs

Package last updated on 01 Apr 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