PParable
All components

Gravity Dots

Visual Effects

A canvas dot-grid field the cursor bends — dots within range are pulled in (or repelled) and spring home with damped overshoot, smearing into capsules while they move. Sleeps when settled, offscreen, or tab-hidden; renders a static grid under reduced motion.

Inspired by Ali Imam — Attraction (aliimam.in/docs, historical) — independently built, not affiliated. Attribution policy

attract · move your cursor

Installation

npx shadcn@latest add https://parable-three.vercel.app/r/gravity-dots.json

Runs the shadcn CLI — the component source is copied intocomponents/parable/gravity-dots.tsx. You own it from there.

Usage

The exact code rendering the preview above.

<GravityDots
    mode="attract"
    radius={120}
    className="h-72 w-full max-w-lg rounded-2xl border border-white/10 bg-[#0f0f10]"
  >
    <div className="pointer-events-none flex h-full items-end justify-center pb-4">
      <span className="font-mono text-[10px] uppercase tracking-[0.2em] text-white/35">
        attract &middot; move your cursor
      </span>
    </div>
  </GravityDots>

Props

GravityDotsProps extends React.HTMLAttributes<HTMLDivElement>

PropTypeDefaultDescription
rowsnumberFixed row count. Omit to derive from container height.
colsnumberFixed column count. Omit to derive from container width.
colorstring"#8b5cf6"Dot colour. Default mirrors the site's `--pb-violet` token.
dotSizenumber2Dot radius in px.
radiusnumber140Pointer influence radius in px.
strengthnumber1Force multiplier — 1 is the tuned default, 2 pulls twice as hard.
mode"attract" | "repel""attract"Whether the pointer pulls dots in or pushes them away.