Components / Backgrounds
Meteors
Shooting stars streaking across any container.
Make a wish
Drop meteors into any relative container.
Installation
Requires React 18+ and Tailwind CSS.
- 1
Install dependencies
$ npm install motion - 2
Add the component
Copy the code from the Code tab above into
components/ui/meteors.tsx. - 3
Use it
example.tsximport { Meteors } from "@/components/ui/meteors"; export default function MeteorsDemo() { return ( <div className="relative flex h-72 w-full items-center justify-center overflow-hidden rounded-2xl border border-zinc-200 dark:border-white/10 bg-gradient-to-b from-zinc-50 dark:from-zinc-900 to-zinc-950"> <Meteors count={20} /> <div className="relative text-center"> <h3 className="text-2xl font-semibold text-zinc-900 dark:text-white">Make a wish</h3> <p className="mt-1 text-sm text-zinc-600 dark:text-zinc-400">Drop meteors into any relative container.</p> </div> </div> ); }
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | 18 | Number of meteors. |
| angle | number | 35 | Degrees below the horizon they travel at. |
| className | string | — | Place inside a relative container. |