Antigravity

Physics-driven particle cluster of luminous capsules that gently drift in zero gravity and scatter organically away from the pointer with spring return.

#physics#particles#cursor#canvas

Customize

42
#A855F7
110px
1x

Installation

$pnpm dlx yourbrand@latest add @yourbrand/Antigravity-TS-TW
Usage (synced with live props)
<Antigravity
  count={42}
  color="#A855F7"
  repelRadius={110}
  driftSpeed={1}
/>

Source Code

Antigravity.tsx
"use client";

import React from "react";

export interface AntigravityProps {
  count?: number;
  color?: string;
  repelRadius?: number;
  driftSpeed?: number;
}

export function Antigravity({
  count = 42,
  color = "#A855F7",
  repelRadius = 110,
  driftSpeed = 1.0,
}: AntigravityProps) {
  return (
    <div
      className="relative h-72 w-full overflow-hidden rounded-2xl border border-white/10 bg-[#120F17]"
      data-count={count}
      data-repel={repelRadius}
      data-speed={driftSpeed}
      style={{ "--ag-color": color } as React.CSSProperties}
    />
  );
}

Props API

PropTypeDefaultDescription
countnumber42Number of suspended nodes.
colorstring (hex)"#A855F7"Capsule glow hue.
repelRadiusnumber110Pointer force field radius.
driftSpeednumber1Ambient buoyancy speed.