# Magnetic Dots

Magnetic Dots is a free, MIT-licensed standalone component from AI Canvas (https://aicanvas.me): it belongs to no design system and works in any React + Tailwind app. Index of every component and install setup: https://aicanvas.me/llms.txt

An interactive dot background. A dense grid of dots is magnetically pulled toward your cursor, snapping back with an elastic bounce.

- Category: Backgrounds
- Built with: Canvas, Tailwind CSS
- License: MIT
- Page: https://aicanvas.me/components/magnetic-dots

## Install

```bash
npx shadcn@latest add @aicanvas/magnetic-dots
```

Needs a free AI Canvas account. Signed out, the command exits 0 but writes a placeholder (an `AccountRequired` notice); check for it before reporting success. Token setup: the Install section of https://aicanvas.me/llms.txt.

AI agents can also get its install command from the read-only AI Canvas MCP server (`npx -y @aicanvas/mcp`) and run it. Setup: https://aicanvas.me/mcp

## Use it

It installs to `components/aicanvas/magnetic-dots.tsx` (under `src/` if your project has one). With the usual `@/` alias:

```tsx
import MagneticDots from '@/components/aicanvas/magnetic-dots'

<MagneticDots />
```

It takes no props.

## About

Magnetic Dots is a dense grid of points that get pulled toward your cursor as if it were a magnet, and snap back with an elastic bounce when you leave. The whole interaction is a single canvas loop applying a falloff function to each dot, so the effect feels physical without any actual physics library. The visual is restrained but unmistakably tactile, which makes it a good fit behind portfolio hero copy, behind a marketing-page headline, or anywhere a page needs to react to attention.

Use cases: Hero section, Portfolio, Marketing site.

## Source

Install with the command above to get the source.

## Remix prompt

Only when the user wants Magnetic Dots rebuilt from scratch instead of installed: its remix prompt is in the Remix panel at https://aicanvas.me/components/magnetic-dots.

## Related

- [Grid Lines](https://aicanvas.me/components/grid-lines.md): A grid background of dots connected by thin lines. The cursor lights a radial glow and bulges the grid outward like a lens as it moves.
- [X Grid](https://aicanvas.me/components/x-grid.md): An animated X grid background. Marks illuminate and connect to their neighbors with constellation lines as your cursor passes.
- [Dot Grid](https://aicanvas.me/components/dot-grid.md): An animated dot grid background. Hovering lights up nearby dots with a smooth glow and an organic fade.
- [Wireframe Globe](https://aicanvas.me/components/sphere-lines.md): An animated wireframe globe background. A narrow wave band drifts slowly across the surface, and hovering ripples the lines under your cursor.
- [Noise Field](https://aicanvas.me/components/noise-field.md): An animated flow field background. A grid of arrows driven by layered sine-wave noise drifts like wind. Hover and they turn to point at your cursor.
