Closed realav closed 2 years ago
Hi, How to add this awesome library as a React component?
particles.js
import Sparticles from "sparticles"; import React, { useState, useEffect } from "react"; export default function Particles() { useEffect(() => { let mySparticles = new Sparticles({ color: "red", count: 10 }, 400, 300); }); return <></>; }
index.js
import Particles from "./particles"; export default function Nav() { return ( <> <Particles /> </> ); }
The particles did appear on my NextJS page but they always appear at the bottom. How to make them appear in the Header.
Hi,
Without a demo I can't say for sure, but it sounds like you need to set the position of the canvas. please read; https://github.com/simeydotme/sparticles#styling for instructions on how to do that.
Hi, How to add this awesome library as a React component?
The particles did appear on my NextJS page but they always appear at the bottom. How to make them appear in the Header.