Meteor Effect, animated React component
A canvas layer of meteors that burn in, pick up speed and leave tapering trails across whatever sits behind it. The pointer bends passing meteors toward it, and a click calls one down to strike that spot in a ring of sparks.
- Free
- Background Effects
- Hover
Like Meteor Effect? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Meteor Effect stays free.
Play with it
Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| number | number | 18 | Base number of meteors in the air, before intensity scales it. |
| className | string | — | Classes for the root. Use "absolute inset-0" to lay it behind content. |
| meteorClassName | string | — | Classes for the canvas the meteors are drawn on. |
| minDelay | number | 0.12 | Shortest wait before a meteor reappears, in seconds. |
| maxDelay | number | 2.4 | Longest wait before a meteor reappears, in seconds. |
| minDuration | number | 3.2 | Fastest crossing, in seconds. |
| maxDuration | number | 7.2 | Slowest crossing, in seconds. |
| angle | number | 215 | Direction of travel in degrees, counter-clockwise from pointing right. 215 heads down and to the left. |
| glow | boolean | true | Bloom round the heads and the impact flash. |
| color | string | "#cfe6ff" | Meteor colour. Any CSS colour, including CSS variables. |
| intensity | "low" | "medium" | "high" | "medium" | Density preset that scales number. |
| hoverOnly | boolean | false | Only spawn meteors while the pointer is over the container. |
| interactive | boolean | true | Pointer gravity bends passing meteors; a click calls one down. |
| stars | number | 0 | Faint twinkling background stars drawn behind the meteors. |
| autoplay | boolean | false | Calls meteors down on a few spots until someone clicks. |
| children | ReactNode | — | Content drawn above the sky. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry
Run this once per project. It writes the Nexus UI entry into
components.jsonfor you:npx shadcn@latest registry add "@nexus-labs=https://www.nexus-ui.com/api/registry/{name}"Type it exactly as shown.
{name}is filled in by the CLI with the component you ask for, so you never replace it.
- 3
Add the component
Run this from your project root. It adds the component, the helpers it imports and its npm packages.
npx shadcn@latest add @nexus-labs/meteors
- 4
Check what was added
With a project made as in the Quick Start (a
src/folder), these files land in it:components/meteors/index.tsmeteors.tsx - 5
Copying by hand? Skip the registry
Instead of steps 2 and 3 you can copy the files yourself, with no registry and no API key. Step 1 still applies, so that
cn()exists. Install the packages:npm install framer-motion
Then show the source and create each file at the path it gives:
- 6
Use it in a page
Installing only adds the files. Import the component in a page and render it. The Usage tab on the preview shows a fuller example with props:
// src/app/page.tsx import { Meteors } from "@/components/meteors"; export default function Page() { return ( <main> <Meteors /> </main> ); }
Like Meteor Effect? 256 more are in Pro.
Pro unlocks all 256 Pro components, every template and block, and everything we release next. Meteor Effect stays free.
About Meteor Effect
The Meteor Effect renders a shower of diagonal streaking particles behind page content using CSS animation. Each meteor is a gradient line that falls at a random angle, opacity, size, and speed. The combined effect creates atmospheric depth and a sense of motion while running entirely on CSS keyframes with zero JavaScript animation overhead. Use it as a hero backdrop, CTA section atmosphere, or full-page background for launch pages and AI products.
Good for
- Hero section background effects
- Product launch page atmospherics
- CTA section backdrop effects
- AI and space-themed product backgrounds
Meteor Effect questions
How do I install the Meteor Effect?
Run `npx shadcn@latest add @nexus-labs/meteors`. It adds the Meteors component to your project and installs framer-motion, its only animation dependency.
How do I change how many meteors appear and which way they fall?
Use `number` (default 18) together with `intensity` ("low", "medium" or "high", which scale the count to 0.65x, 1x or 1.45x, capped at 72). `angle` sets the travel direction in degrees (default 215), and `minDuration`/`maxDuration` and `minDelay`/`maxDelay` control speed and spacing.
Can the meteors only animate on hover?
Yes. Set `hoverOnly` and the meteors only show while the pointer is over the container. Anything you pass as `children` renders above the meteor layer, so you can wrap a card or hero with it.
Does it respect reduced motion?
Yes. When the user has prefers-reduced-motion turned on, the meteors stay in place as faint static streaks instead of moving.