We can add Particles.js in our react project by using react-particles. Adding this to your react project will surely attract more audiences.
1. Installation Process: Run the following command on terminal to install Particles.js
- For npm:
npm install react-particles-js
- For yarn:
yarn add react-particles-js
2. Import the packages: Import the package in your file. To import the package paste the following code:
import Particles from 'react-particles-js';
3. Render: Inside return of render function of your component add the element <particles />. Some important props are:
- width: Width of Canvas.
- Height: Height of Canvas.
- Params: Parameter to be passed.
4. Start Start the npm by using
npm start command and you will get a great attractive background.
Note: Add <particles /> element as the last element in your returning div.
- What is the difference between React Native and React?
- Difference between Web Project and Traditional Project
- Why You Should Choose React Native?
- How React Native works?
- Difference between React.js and Angular.js
- Code Splitting in React
- React.js (Introduction and Working)
- ReactJS | State in React
- Introduction to React Hooks
- File uploading in React.js
- Introduction to React-Redux
- Difference between React Native and Flutter
- React.js | Uncontrolled Vs Controlled Inputs
- Material UI Introduction and Installation for React
- Getting started with React Native? Read this first !
- How to Create Button in React-Native App ?
- React Native | Expo - BarCodeScanner
- How to Deploy Your React Websites on GitHub?
- 7 React Best Practices Every Web Developer Should Follow
- Android & iOS App development using React Native with Expo
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.