How to properly include particles.js in sage 9?

Hello :slight_smile: , I have been trying to integrate particlesjs for my custom theme but it wasn’t sucessfull.
I followed these two relevant threads and to include particles js but it didn’t worked either.

Has anybody successfully integrated particlesjs in sage 9 theme ? Any help on this would be great. Thankyou

1 Like

Mhm this istn tested but I’d say:
yarn add particlesjs (or yarn add particles.js (

Then you have to import in common.js

import {particles} from 'particlesjs';


export default {
  init() {
    selector: '.background'

thanks , i tried that way it didn’t worked

I also have this problem.

yarn add particlesjs is a stripped down version of the other version. the solution above works (I removed the {} around particles).

I tried,
yarn add particles.js

with my home.js being this:

import {particlesJS} from 'particles.js';
export default {
  init() {
    // JavaScript to be fired on the home page
    particlesJS.load('particles-js', {JSON settings});

  finalize() {
    // JavaScript to be fired on the home page, after the init JS

But when i do that, and import in the home. I get load not defined.

Did you ever figure it out?