Xzero UI
Pro library

Gravity wellPro

A grid of tiles that bends toward the cursor like spacetime, with a click that sends a shockwave through it.

$ pnpm dlx shadcn@4.23.0 add @xzero-ui-pro/gravity-well
Live · keyboard ready

When to use

When not to use

Installation

Register both Xzero UI namespaces in your project's components.json:

{
  "registries": {
    "@xzero-ui": "https://mcp.xzero.co.uk/r/{name}.json",
    "@xzero-ui-pro": "https://mcp.xzero.co.uk/r/pro/{name}.json"
  }
}
npx shadcn@4.23.0 add @xzero-ui-pro/gravity-well

Install xzero-foundation once, and import @/components/xzero/foundation.css in your app root. No Xzero token is used by this snapshot. For sample portraits, photos, fonts, or logos, download https://mcp.xzero.co.uk/install-assets.mjs and run node xzero-install-assets.mjs <receiving-project>.

Usage

import { GravityWell } from "@/components/xzero/gravity-well/gravity-well";

export function Team({ people }: { people: { name: string; src: string }[] }) {
  return (
    <GravityWell label="Team">
      {people.map(person => <img key={person.src} src={person.src} alt={person.name} />)}
    </GravityWell>
  );
}

API reference

GravityWell

A grid of tiles that bends toward the pointer like spacetime around a mass. Tiles near the well lean in, shrink, and dim on their own springs; a click sends a shockwave rolling outward through the grid.

PropTypeDefaultDescription
children (required)ReactNode–One tile per child. Photos, avatars, icons, or any small content.
columnsnumber–Fixed column count. Leave it out to fit as many columns as minTileSize allows.
minTileSizenumber56Smallest tile width in px when columns is not set.
gapnumber8Gap between tiles in px.
radiusnumber150Reach of the well in px.
strengthnumber1Pull strength from 0 to about 1.5.
onPulse(origin: { x: number; y: number }) => void–Called when a click or key sends a shockwave, with its origin in px from the top left of the grid.
labelstring"Gravity well"Accessible name for the grid.
classNamestring–Extra class on the root.
styleCSSProperties–Inline styles on the root.

Keyboard interactions

KeysAction
TabFocuses the grid and places the well on the current tile.
Arrow keysMoves the well from tile to tile.
Home / EndMoves the well to the first or last tile.
Space or EnterSends a shockwave from the current tile.

Accessibility

Motion

Responsive behavior

Performance

Notes for AI

Also in cursor

Guidance for AI tools

Gravity well: A grid of tiles that bends toward the cursor like spacetime, with a click that sends a shockwave through it. Follow the declared prop types and do not invent props. Keep keyboard access, reduced motion support, and both light and dark themes intact when adapting it.

Full library index: https://ui.xzero.co.uk/llms.txt

Browse all components