Skip to content

stipple-glParticles that become your artwork.

A WebGL2 particle field that morphs into any SVG. Zero dependencies, 12.4 KB gzipped, and it will run the whole simulation on a worker if you ask it to.

A particle field dispersing, gathering into a hexagon, morphing into a spirograph, and dispersing again

Install

bash
npm i stipple-gl

The whole common case

ts
import { Stipple, shapeFromURL } from 'stipple-gl';

const field = new Stipple('#hero');

await field.morphTo(await shapeFromURL('/logo.svg'));

That is the entire API surface for most uses. Everything else is opt-in — and if you want to check before you build, isSupported() tells you whether WebGL2 is available so an unsupported browser gets a fallback rather than an exception.

ts
import { isSupported, Stipple } from 'stipple-gl';

if (isSupported()) new Stipple('#hero');
else document.querySelector('#hero').classList.add('static-fallback');

In React

stipple-gl/react ships its own 'use client' directive, so Particles drops straight into a Next.js App Router server component with no wrapper and no dynamic import.

tsx
import { Particles } from 'stipple-gl/react';

export default function Hero() {
  return <Particles count={3500} shape="/logo.svg" />;
}

Props are compared structurally rather than by reference, so writing options inline is fine — an idle re-render of the parent reaches the engine as nothing at all. See React for the detail.

Released under the MIT License.