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-TWUsage (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
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | 42 | Number of suspended nodes. |
| color | string (hex) | "#A855F7" | Capsule glow hue. |
| repelRadius | number | 110 | Pointer force field radius. |
| driftSpeed | number | 1 | Ambient buoyancy speed. |