New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@slithy/math-particles

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@slithy/math-particles

Animated math equations particle overlay for React.

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

@slithy/math-particles

Animated math equations particle overlay for React. Equations drift outward from the center of the container, scaling and fading over time. No animation library — the loop runs in a Web Worker via OffscreenCanvas, keeping the main thread free.

Installation

npm install @slithy/math-particles

Peer dependencies: react@^17 || ^18 || ^19, react-dom@^17 || ^18 || ^19

Vite setup

This package ships a Web Worker and is incompatible with Vite's dependency optimizer. Add it to optimizeDeps.exclude in your Vite config:

// vite.config.ts
optimizeDeps: {
  exclude: ['@slithy/math-particles']
}

The same applies to electron-vite projects — the exclusion goes under renderer.optimizeDeps.exclude.

MathParticlesOverlay

Fills its nearest positioned ancestor. Give the parent position: relative and defined dimensions.

import { MathParticlesOverlay } from '@slithy/math-particles'

<div style={{ position: 'relative', width: '100%', height: 480 }}>
  <MathParticlesOverlay />
</div>

Props:

PropTypeDefaultDescription
backgroundColorstring"#07070f"Background fill color of the container
blurbooleantrueApplies a soft blur at the start and end of each particle's lifecycle
colorsstring[]ColorBrewer RdYlBuArray of colors to pick from randomly per particle
densitynumber1Multiplier on the auto-calculated particle count. 0.5 = half, 2 = double. Fixed at mount — use a key prop to reinitialize.
fadeInbooleantrueFades the canvas in on mount
fadeInDurationnumber800Duration of the mount fade-in in milliseconds
reversebooleanfalseReverses the animation: equations start large and drift inward rather than starting small and drifting outward
speednumber1Multiplier on particle animation speed. 0.5 = half speed, 2 = double.

Equations

16 equations are included: Euler's identity, Euler's formula, Pythagorean theorem, Pythagorean trig identity, quadratic formula, Einstein mass-energy, Fourier transform, Schrödinger equation, Gaussian integral, Taylor series, Navier-Stokes, Maxwell's first equation, Riemann zeta function, Bayes' theorem, integration by parts, and Heisenberg uncertainty.

Examples

Custom colors

<MathParticlesOverlay colors={["#e63946", "#457b9d", "#f1faee"]} />

Reduced density

<MathParticlesOverlay density={0.5} />

Reversed direction

<MathParticlesOverlay reverse />

No blur

<MathParticlesOverlay blur={false} />

No fade-in

<MathParticlesOverlay fadeIn={false} />

Transparent background

<div style={{ position: 'relative', width: '100%', height: 480, background: 'your-bg' }}>
  <MathParticlesOverlay backgroundColor="transparent" />
</div>

Keywords

react

FAQs

Package last updated on 31 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts