Elastic Grid
A rubber-sheet grid: the pointer is a lens that bulges (or pinches) the mesh, stretched edges glow, and every vertex springs back with a wobble. Clicks punch it.
canvasspringspointerclick5 files · 425 locdeps: clsx, tailwind-merge
Installation
With the shadcn CLI, pointing at this platform’s registry:
npx shadcn@latest add https://opusui.131199999.xyz/r/elastic-grid.jsonOr offline, straight from your opus55 checkout (copies every file it needs):
node ../tailwind_component/opus55/scripts/add.mjs elastic-gridUsage
import { ElasticGrid } from "@/components/opus/backgrounds/elastic-grid";
<ElasticGrid strength={0.6} className="absolute inset-0" />API
| Prop | Type | Default | Description |
|---|---|---|---|
| color / accent | string | — | Line colour and stretch glow. |
| cell | number | 40 | Grid cell size (px). |
| radius | number | 180 | Lens radius (px). |
| strength | number | 0.6 | Positive bulges, negative pinches (−1..1). |
| stiffness | number | 0.07 | Spring stiffness. |
| interactive | boolean | true | React to the pointer (tracked on window). |
| className | string | — | Wrapper classes — `absolute inset-0` to fill a relative parent. |
| children | ReactNode | — | Optional content rendered above the canvas. |
Notes
- Canvas 2D with a device-pixel-ratio aware backing store (capped at 2×).
- The animation loop stops off-screen and in hidden tabs; resize re-seeds the scene.
prefers-reduced-motion: reducedraws a single static frame.