Skip to content

pastetaste

Pointer Swarm

BackgroundsCanvasInteraction

A field of spring-tethered particles that the pointer pushes, pulls or stirs; displaced dots light up and streak. One 2D canvas.

Paste it into Claude Code: it installs the component, asks for your brand and content, and places it on the page you name.

Install

Or by hand, in a Next.js project with shadcn set up. It writes components/pastetaste/pointer-swarm.tsx.

npx shadcn@latest add https://pastetaste.com/r/pointer-swarm.json

Prompt

Install the pastetaste component "Pointer Swarm" (pointer-swarm) into this Next.js project and use it.

What it is: A field of spring-tethered particles that the pointer pushes, pulls or stirs; displaced dots light up and streak. One 2D canvas.

Before you place it, ask me (one short message, in my language; "skip" = sensible default): which page and section it goes in, my brand colour (hex), the text, labels or images it should show, and whether I want my logo or my own copy in the demo content. Then:

Steps:
1. If the project has no components.json, run: npx shadcn@latest init -y -d. Then run: npx shadcn@latest add https://pastetaste.com/r/pointer-swarm.json
   (it writes components/pastetaste/pointer-swarm.tsx; install any npm packages it reports).
2. Import it: import { PointerSwarm } from "@/components/pastetaste/pointer-swarm" (check the file for the exact named export).
3. Put it where it fits on the page I name, keep the rest of the page untouched, and pass props for my colours instead of editing the installed file.
4. It does not depend on Tailwind; colours come from CSS variables (--pt-*) or props.
5. It supports prefers-reduced-motion with a still state; do not remove it.

Props (all optional unless the type has no default):
- color: string = computed CSS color — Resting dot colour; inherits `color`.
- accent: string = '#c8ff3b' — Colour of displaced dots.
- mode: 'repel' | 'attract' | 'swirl' = 'repel' — What the pointer does to nearby particles.
- spacing: number = 24 — Distance between home positions in px; smaller means more particles (capped at ~2600).
- radius: number = 170 — Radius of the pointer influence in px.
- strength: number = 1 — Force multiplier.
- size: number = 1.4 — Dot radius in px at rest.
- roam: boolean = true — A ghost pointer wanders through the field while the real one is idle.
- opacity: number = 0.55 — Resting opacity of the field.

Live preview: https://pastetaste.com/c/pointer-swarm
Then run the dev server, check it in the browser at desktop and mobile width, and tell me the page URL.

Props 9

PropTypeDefaultDescription
colorstringcomputed CSS colorResting dot colour; inherits `color`.
accentstring'#c8ff3b'Colour of displaced dots.
mode'repel' | 'attract' | 'swirl''repel'What the pointer does to nearby particles.
spacingnumber24Distance between home positions in px; smaller means more particles (capped at ~2600).
radiusnumber170Radius of the pointer influence in px.
strengthnumber1Force multiplier.
sizenumber1.4Dot radius in px at rest.
roambooleantrueA ghost pointer wanders through the field while the real one is idle.
opacitynumber0.55Resting opacity of the field.
View all →