Kinetic UI
Back to Introduction
Shader Physics

Interactive Particle Swarm

A highly performant 3D particle swarm shader that repels organically from the user cursor.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add particle-swarm

The InteractiveParticleSwarm instantiates thousands of Three.js particles via a custom BufferGeometry. A vertex shader calculates real-time mouse repulsion using a distance field, while Additive Blending handles lighting.

Live Preview

interactive-particle-swarm
INITIALIZING_SWARM

HOVER SWARM

Installation

npx kinetic-ui-cli@latest add
PropTypeDefaultDescription

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { ParticleSwarm } from "@/components/creative/particle-swarm";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { ParticleSwarm } from "@/components/creative/particle-swarm";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <ParticleSwarm
      >
        <div>Content goes here</div>
      </ParticleSwarm>
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.