SVG Particle
SVG Particle is a particle background in the UI HUB particle backgrounds collection. An image is decoded once into an offscreen canvas, scanned on a pixel grid and turned into a particle array where each dot keeps the exact RGBA of its pixel. One requestAnimationFrame loop writes into a single persistent ImageData buffer and blits it, so thousands of dots cost one putImageData.
The component is driven by 30 documented props (imageConfig, imageConfig.image, imageConfig.mode, imageConfig.sizeUnit, imageConfig.widthPx, imageConfig.heightPx and 24 more), so colours, intensity, timing and density can be tuned from the call site instead of being hard-coded.
Implementation notes: Canvas 2D ImageData buffer; Local bundled default image; crossOrigin anonymous image load with no-CORS retry.
Preview the particle background in the browser above, copy the source, and paste it into your project. Particle Backgrounds components in UI HUB are grouped by category so you can compare effects side by side before choosing one.
What is SVG Particle?
A photograph dissolved into a cloud of coloured particles that drift at half opacity, then snap back into the picture as you move across it. Every dot keeps the exact RGB of the pixel it was sampled from, the pointer pushes them away, and the dot count, size, shape and palette are all props.
SVG Particle at a glance
- Category
- Particle Backgrounds
- Pricing
- Free to use
- Libraries
- React
- Language
- TypeScript
- Styling
- Tailwind CSS
- Configurable props
- 30
- AI prompts
- Ready for Advance, Antigravity, Claude Code, Cursor, Lovable
How SVG Particle works
An image is decoded once into an offscreen canvas, scanned on a pixel grid and turned into a particle array where each dot keeps the exact RGBA of its pixel. One requestAnimationFrame loop writes into a single persistent ImageData buffer and blits it, so thousands of dots cost one putImageData. A four-state machine (active, assembling, scattering, idle) eases each particle between its scatter position and its home position, either roaming inside a rectangle, circle or oval at roamOpacity while idle or hiding entirely, and a smoothed pointer repulsion field pushes dots out of the cursor with velocity-scaled falloff. Dot size, shape, palette and sampling density are all props.
Technical information for SVG Particle
| Category | Particle Backgrounds |
|---|---|
| Libraries | React |
| Styling | Tailwind CSS |
| Language | TypeScript |
| Rendering | HTML canvas, spring physics, ResizeObserver |
| State change | a drifting half-opacity cloud of coloured dots inside the roam shape to the cloud snapping back into the source photograph dot by dot while the pointer clears a hole around the cursor |
| Props | 30 configurable |
| Usage example | Not published yet |
What SVG Particle requires
- Canvas 2D ImageData buffer
- Local bundled default image
- crossOrigin anonymous image load with no-CORS retry
- Module-level decoded-image and sampled-dot caches
- Image + offscreen Canvas2D pixel sampling with willReadFrequently
- Particle-count cap of 24000 via adaptive sampling gap
- ResizeObserver
- requestAnimationFrame loop
- Pointer events for assemble/scatter and repulsion
- devicePixelRatio-aware drawing
SVG Particle questions
What is SVG Particle?
A photograph dissolved into a cloud of coloured particles that drift at half opacity, then snap back into the picture as you move across it. Every dot keeps the exact RGB of the pixel it was sampled from, the pointer pushes them away, and the dot count, size, shape and palette are all props.
How does SVG Particle work?
An image is decoded once into an offscreen canvas, scanned on a pixel grid and turned into a particle array where each dot keeps the exact RGBA of its pixel. One requestAnimationFrame loop writes into a single persistent ImageData buffer and blits it, so thousands of dots cost one putImageData. A four-state machine (active, assembling, scattering, idle) eases each particle between its scatter position and its home position, either roaming inside a rectangle, circle or oval at roamOpacity while idle or hiding entirely, and a smoothed pointer repulsion field pushes dots out of the cursor with velocity-scaled falloff. Dot size, shape, palette and sampling density are all props.
Which category does SVG Particle belong to?
SVG Particle is listed under Particle Backgrounds in the UI HUB catalog. Particle backgrounds render tens of thousands of points on the GPU: spheres, halos, fields and constellations that drift, glow and react to the pointer. They are the heaviest components in the library, so each one lists its rendering approach and requirements before you copy it. Use them as hero backdrops, section backgrounds or full-page intros where a static gradient would fall flat.
What does the imageConfig prop do in SVG Particle?
Sampling box: how the source image is fitted and scaled before its pixels are read. It defaults to see nested rows.
What does the imageConfig.image prop do in SVG Particle?
Source image URL. Defaults to a local asset shipped in public/assets so the first frame needs no network round trip. Loaded with crossOrigin anonymous and retried without CORS if that fails; the decoded image and the sampled dot set are cached across mounts. It defaults to /assets/svg-particle/particle-art.jpg.
Is SVG Particle free to use?
SVG Particle is a free component on UI HUB. You can preview it in the browser and read the full props table on the component page.
Which libraries does SVG Particle use?
SVG Particle uses React and is styled with Tailwind CSS.
What does SVG Particle need to run?
SVG Particle needs Canvas 2D ImageData buffer, Local bundled default image, crossOrigin anonymous image load with no-CORS retry and Module-level decoded-image and sampled-dot caches.