JGuang

Meteors

Meteors · Magic UI

Preview
npx shadcn@latest add https://jiguang132.com/r/magic-ui/meteors.json

Some upstream demos use online images, videos or tweets. That content depends on network access and third-party services.

Meteors

Install: npx shadcn@latest add https://jiguang132.com/r/magic-ui/meteors.json

Use case

Animate decorative meteor streaks.

Native props used by the examples

Extracted from all local examples for this entry, grouped by imported module and native owner, including other Magic components used by compound demos. This is not an exhaustive API or a universal host variant. Inspect spread object declarations and the source types/defaults below.

Owning component propExplanationExample source
Meteors.number (meteors)Number of meteor elements.examples/meteors-demo.tsx

Interaction and state checks

  • Meteors Demo — meteors-demo

These names identify real example entries, not new component props or extra components. Check pointer/keyboard behavior, themes, small screens and failures for the selected example. Decorative effects must not invent disabled/error/submission states. Complete example installation includes the actual dependency closure.

Business integration boundary

Increasing number adds DOM and animation work; use a static alternative for reduced motion.

Host and motion setup

Initialize Tailwind CSS v4, semantic CSS variables and the dark variant; import the independent local Registry namespace. Reuse an existing next-themes Provider without substituting JGuang UI/Base UI/HeroUI APIs. Mount effects in view and unmount offscreen; provide static alternatives for unavailable Canvas/WebGL or failed remote media. Respect prefers-reduced-motion and verify timer/RAF/observer/listener cleanup: stopping CSS alone does not prove the engine stopped. Examples provide no backend, login, payment or real AI stream. This practical guide is bilingual; detailed upstream references and demo text retain their original language.

Available examples

meteors-demo

Demo state and mock data do not provide a backend service. Inspect the component props before wiring real data.

Installation

<Tabs defaultValue="cli"> <TabsList> <TabsTrigger value="cli">CLI</TabsTrigger> <TabsTrigger value="manual">Manual</TabsTrigger> </TabsList> <TabsContent value="cli">
npx shadcn@latest add @magicui/meteors
</TabsContent> <TabsContent value="manual"> <Steps>

<Step>Copy and paste the following code into your project.</Step>

<Step>Update the import paths to match your project setup.</Step>

<Step>Add the required CSS animations</Step>

Add the following animations to your global CSS file.

@theme inline {
  --animate-meteor: meteor 5s linear infinite;

  @keyframes meteor {
    0% {
      transform: rotate(var(--angle)) translateX(0);
      opacity: 1;
    }
    70% {
      opacity: 1;
    }
    100% {
      transform: rotate(var(--angle)) translateX(-500px);
      opacity: 0;
    }
  }
}
</Steps> </TabsContent> </Tabs>

Usage

import { Meteors } from "@/components/ui/meteors"
<div className="relative h-[500px] w-full overflow-hidden">
  <Meteors />
</div>

Props

Meteors

PropTypeDefaultDescription
numbernumber20Number of meteors
minDelaynumber0.2Minimum delay in seconds before meteor animation starts
maxDelaynumber1.2Maximum delay in seconds before meteor animation starts
minDurationnumber2Minimum duration in seconds for meteor animation
maxDurationnumber10Maximum duration in seconds for meteor animation
anglenumber215Angle in degrees for meteor trajectory
classNamestring-Optional additional CSS classes

Complete example installation

The component command installs the component. Each example command also includes its actual imported components, native support UI, utilities and pinned dependencies. Helpers are not additional catalog components.

Meteors Demo

npx shadcn@latest add https://jiguang132.com/r/magic-ui/examples/meteors/meteors-demo.json

Default import: @/components/magicui/examples/meteors-demo

Dependencies: clsx@2.1.1, tailwind-merge@3.6.0

Minimal usage and theme

import Demo from '@/components/magicui/examples/meteors-demo';
import { ThemeProvider } from 'next-themes';
export default function Example() {
  return <ThemeProvider attribute="class" defaultTheme="system" enableSystem><Demo /></ThemeProvider>;
}

Initialize Tailwind CSS v4, semantic color variables and the dark variant first. Reuse an existing next-themes provider rather than nesting another. Next Link examples require a Next.js environment; in static Vite projects adapt the demo links to your router without changing the native component API. Some media and tweets require network access. Examples do not supply authentication or backend services.

Source-backed parameter reference

Implementation signatures and types are generated from the pinned local source. Optional props, native inherited types, union branches and never exclusions are preserved. A forwardRef implementation's ref is a React reference, not an additional business prop.

Meteors({
  number = 20,
  minDelay = 0.2,
  maxDelay = 1.2,
  minDuration = 2,
  maxDuration = 10,
  angle = 215,
  className,
}: MeteorsProps)
interface MeteorsProps {
  number?: number
  minDelay?: number
  maxDelay?: number
  minDuration?: number
  maxDuration?: number
  angle?: number
  className?: string
}

Destructuring defaults in source

Only defaults written directly in parameter/props destructuring are listed. Conditional expressions, runtime theme and computed values require source inspection; this is not an exhaustive behavior-default list.

// Meteors
number = 20

// Meteors
minDelay = 0.2

// Meteors
maxDelay = 1.2

// Meteors
minDuration = 2

// Meteors
maxDuration = 10

// Meteors
angle = 215