# Meteors

> React meteors background that sends accent colored streaks with fading tails falling diagonally behind your content, with count, angle and speed props.

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/meteors
- Source (registry JSON with the full file): https://ui.minidev.pro/r/meteors.json
- License: MIT. One file, yours to edit after install.

## When to use

Use it behind a dark, quiet hero or release announcement. Reach for Particles when the backdrop should react to the pointer, and RetroGrid or Ripple for a steadier geometric backdrop.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/meteors
```

Writes `components/ui/meteors.tsx` plus the MiniDev files it is built from (button) and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/meteors.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { Meteors } from "@/components/ui/meteors"
```

From the npm package:

```tsx
import { Meteors } from "minidev-ui-kit/premium/meteors"
```

## Usage

```tsx
import { Meteors } from "@/components/ui/meteors"

export function Example() {
  return (
    <Meteors />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `count` | `number` | `16` | no | How many meteors are in flight at once. |
| `angle` | `number` | `140` | no | Direction of travel in degrees. 0 points right, 90 falls straight down. |
| `speed` | `number` | `1` | no | Speed multiplier. 2 is twice as fast, 0.5 half as fast. |
| `tail` | `number` | `110` | no | Tail length in pixels. |
| `className` | `string` | - | no |  |
| `children` | `React.ReactNode` | - | no |  |

## Examples

### Custom content

Children sit above the streaks and keep the pointer; the panel fills its container width.

```tsx
<Meteors className="h-72">
  <div className="flex h-full flex-col items-center justify-center gap-4 px-6 text-center">
    <p className="max-w-[20ch] text-2xl font-medium tracking-[-0.03em] text-balance text-fg">Northwind closed the quarter in 4 days</p>
    <p className="max-w-sm text-sm text-fg-muted">Read how a 40 person finance team moved 1,200 invoices to Lumen.</p>
    <Button variant="outline">Read the story <ArrowRightIcon /></Button>
  </div>
</Meteors>
```

### Angle and speed

angle is degrees of travel, 90 is straight down; speed multiplies the pace and count adds streaks.

```tsx
<Meteors angle={110} speed={1.6} count={28} className="h-64" />
```

### Sparse and slow

A handful of long, slow meteors reads as weather behind a quiet section.

```tsx
<Meteors count={6} speed={0.6} tail={180} className="h-64">
  <div className="flex h-full flex-col items-center justify-center gap-3 px-6 text-center">
    <span className="flex items-center gap-2 text-sm text-fg-muted">
      <span className="size-2 rounded-full bg-success" aria-hidden /> All systems operational
    </span>
    <p className="text-xl font-medium tracking-[-0.02em] text-fg">Lumen status</p>
    <p className="text-xs text-fg-subtle">Last incident 42 days ago</p>
  </div>
</Meteors>
```

## Accessibility

- The meteor layer is `aria-hidden` and `pointer-events-none`.
- Under reduced motion each meteor is drawn once, still and at half strength, along its path.
- Animations pause when the panel is more than 80px outside the viewport.

## FAQ

### Why are there no meteors in the server HTML?

Paths depend on the panel size, so they are measured with a `ResizeObserver` after mount. The server renders the panel and your content only, and hydration matches.

### How do I change direction, density or speed?

`angle` sets the direction in degrees (0 points right, 90 falls straight down; default 140). `count` is how many are in flight (16), `speed` multiplies the pace and `tail` sets the streak length in pixels.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`
- Built from: [button](https://ui.minidev.pro/docs/button/md)

## Related

- [Particles](https://ui.minidev.pro/docs/particles/md): React canvas background of drifting particles that repel or attract around the pointer, colored from your accent token and sharp on high density screens.
- [Retro Grid](https://ui.minidev.pro/docs/retro-grid/md): React retro grid background: a perspective floor receding to a glowing horizon that scrolls slowly toward the viewer, with angle and cell size props.
- [Ripple](https://ui.minidev.pro/docs/ripple/md): React background of concentric rings that pulse outward from the center or any point, staggered and fading, plus an extra ripple from each click or tap.
- [Lamp Effect](https://ui.minidev.pro/docs/lamp-effect/md): A React lamp effect for dark hero panels: a thin bright line at the top switches on and widens, casting a soft cone of light on the headline beneath it.
- [Wavy Background](https://ui.minidev.pro/docs/wavy-background/md): React canvas background of layered sine waves rolling behind your content, with colour, speed, amplitude and blur props, sharp on retina and paused off screen.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
