A slow-drifting night sky with twinkling stars, for space, launch and AI product heroes.
Shooting stars streaking across a dotted sky at scattered times.
Customize
Usage
import { Meteors } from "@/components/motionkit/meteors";
<Meteors className="h-96 rounded-3xl">
<h1>Your hero</h1>
</Meteors>Motion
The exact curves this component runs, plotted with Motion's own maths.
Streak
Runs on its own
Space and AI heroes, launch announcements and dark landing pages that want occasional movement.
Each meteor is a bright head with a gradient tail, sent down and to the left at a fixed angle with a fade in and out. Fixed pseudo-random delays scatter them, and a still dot texture underneath keeps the sky from looking empty between meteors or with reduced motion on.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/meteors.jsonnpm install motionSave as components/motionkit/meteors.tsx.
"use client";
import type { ReactNode } from "react";
import { motion, useReducedMotion } from "motion/react";
type MeteorsProps = {
children?: ReactNode;
/** Number of meteors in flight. */
count?: number;
/** Seconds for one meteor to cross. */
duration?: number;
/** Colour of the meteor head and tail. */
color?: string;
className?: string;
};
// fixed pseudo-random offsets so meteors look scattered but render identically on server and client
const scatter = (index: number) => ((index * 7919) % 100) / 100;
// meteors fall down and to the left at this angle below the horizon
const ANGLE = 35;
const TRAVEL = 700;
const dx = -Math.cos((ANGLE * Math.PI) / 180) * TRAVEL;
const dy = Math.sin((ANGLE * Math.PI) / 180) * TRAVEL;
export function Meteors({ children, count = 12, duration = 2.4, color = "#F6F1E8", className = "" }: MeteorsProps) {
const reduceMotion = useReducedMotion();
return (
<div className={`relative isolate overflow-hidden bg-[#0C1010] ${className}`}>
{/* a still dot texture, so the sky is never empty between meteors or with reduced motion */}
<div aria-hidden className="absolute inset-0 -z-10 bg-[radial-gradient(#ffffff12_1px,transparent_1px)] [background-size:22px_22px]" />
{!reduceMotion && (
<div aria-hidden className="absolute inset-0 -z-10">
{Array.from({ length: count }, (_, index) => (
<motion.span
key={index}
className="absolute h-px w-28"
style={{
left: `${15 + scatter(index) * 100}%`,
top: `${-10 + scatter(index + 4) * 45}%`,
rotate: -ANGLE,
originX: 0,
background: `linear-gradient(to right, ${color}, transparent)`,
}}
initial={{ opacity: 0 }}
animate={{ x: [0, dx], y: [0, dy], opacity: [0, 1, 1, 0] }}
transition={{
duration: duration * (0.75 + scatter(index + 2) * 0.5),
delay: scatter(index + 6) * duration * 2,
repeat: Infinity,
repeatDelay: scatter(index + 9) * duration * 2,
ease: "linear",
}}
>
{/* the bright head */}
<span className="absolute -left-0.5 -top-[1.5px] size-1 rounded-full" style={{ backgroundColor: color, boxShadow: `0 0 8px 2px ${color}` }} />
</motion.span>
))}
</div>
)}
{children}
</div>
);
}
| Prop | Type | Default | Description |
|---|---|---|---|
| count | number | 12 | Number of meteors in flight. |
| duration | number | 2.4 | Seconds for one meteor to cross. |
| color | string | "#F6F1E8" | Colour of the meteor head and tail. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Only the motion package, beside React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/meteors.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
Meteors are removed for reduced-motion users, leaving the still dot texture. It loops forever otherwise, so if it sits beside other content for more than 5 seconds, WCAG 2.2.2 asks you to add a pause control.
A slow-drifting night sky with twinkling stars, for space, launch and AI product heroes.
Thin grid lines with streaks of light falling down them at scattered times.
A black hole with a glowing accretion disc: particles orbit faster near the centre, spiral inwards and pass behind the dark shadow.
Make a wish