DEV Community

Cover image for [Angular] How to create beautiful and realistic confetti animations using tsParticles
Matteo Bruni for tsParticles

Posted on • Updated on

[Angular] How to create beautiful and realistic confetti animations using tsParticles

I wrote a post about tsParticles and the new confetti animation created in the 1.30 version.

This configuration can be used as is in any Angular tsParticles installation (ng-particles package).

app.module.ts

import { NgParticlesModule } from "ng-particles";

@NgModule({
  declarations: [/* ... */],
  imports: [/* ... */, NgParticlesModule],
  providers: [],
  bootstrap: [/* ... */]
})
Enter fullscreen mode Exit fullscreen mode

app.component.html

<!-- this component can be placed anywhere -->
<Particles id="tsparticles" [options]="options"></Particles>
Enter fullscreen mode Exit fullscreen mode

app.component.ts

export class AppComponent {
  options = {
    /* ... */
  }

  /* ... */
}
Enter fullscreen mode Exit fullscreen mode

A working sample can be found below

GitHub logo matteobruni / tsparticles

tsParticles - Easily create highly customizable JavaScript particles effects, confetti explosions and fireworks animations and use them as animated backgrounds for your website. Ready to use components available for React.js, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Inferno, Solid, Riot and Web Components.

Top comments (0)