explaingit

vincentgarreau/particles.js

30,202JavaScriptAudience · vibe coderComplexity · 2/5DormantLicenseSetup · easy

TLDR

Lightweight JavaScript library that adds animated, interactive floating particles to web page backgrounds with zero code changes, just configure via JSON.

Mindmap

mindmap
  root((particles.js))
    What it does
      Animated particles
      Mouse interactions
      Line connections
    Configuration
      JSON-based setup
      Color and shape
      Speed and direction
    Use cases
      Landing pages
      Portfolio sites
      Login screens
    Tech stack
      JavaScript
      npm or CDN
      HTML element

Things people build with this

USE CASE 1

Add an animated particle background to a landing page or portfolio site without writing animation code.

USE CASE 2

Create interactive effects where particles scatter away from mouse movement or respond to clicks.

USE CASE 3

Build a modern login or signup screen with a dynamic, engaging visual background.

Tech stack

JavaScriptHTML5 CanvasJSON

Getting it running

Difficulty · easy Time to first run · 5min
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

In plain English

particles.js is a lightweight JavaScript library that adds animated, interactive floating particles to a web page background. You have likely seen this effect on websites where small dots or shapes drift around the screen, sometimes connecting with lines or reacting when you hover your mouse over them. This library makes it straightforward to add that visual effect without writing complex animation code yourself. To use it, you add one HTML element to your page, load the library script, and then point it at a JSON configuration file where you set all the visual details: how many particles appear, their color, shape (circles, triangles, polygons, stars, or custom images), size, speed, and direction of movement. You can also control interactivity, for example, particles can scatter away from the mouse cursor, grow larger when hovered, or new ones can appear when you click. The configuration is entirely data-driven, so no code changes are needed to adjust the look and feel. You would use this when building a landing page, portfolio site, or login screen where you want a dynamic, modern background effect without pulling in a large dependency. The library is written in JavaScript and can be installed via npm, included from a content delivery network, or added directly as a script tag in your HTML.

Copy-paste prompts

Prompt 1
Show me how to set up particles.js on my website with a JSON config that makes blue particles drift around and react to my mouse.
Prompt 2
I want particles that form lines connecting to each other, what JSON settings do I need in particles.js to enable that?
Prompt 3
How do I customize particle shapes (circles, stars, triangles) and colors in particles.js without touching JavaScript code?
Prompt 4
Can you help me install particles.js via npm and point it to a config file that makes particles appear on click?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.