This library is not production-ready yet. Developers should use it with caution and expect breaking changes.

Meteor

Animated meteor falling from the sky with a fiery trail and impact explosion effect.

Installation

First, make sure you have the base map component installed:

npx shadcn@latest add https://www.terrae.dev/map.json

Then install the meteor component:

npx shadcn@latest add https://www.terrae.dev/meteor.json

Meteor Shower

Enable shower mode to create multiple meteors falling in sequence. Use showerCount to control how many meteors appear in each wave.

Intensity

Control the overall power of the meteor with intensity. Higher values create larger meteors with longer tails, more trail particles, and bigger impact explosions. Use values below 1 for subtle effects or above 1 for dramatic strikes.

Custom Colors

Customize the meteor appearance with meteorColor (core color), trailColor (tail particles), and impactColor (explosion flash). Create ice comets, green meteors, or any color variation.

Programmatic Control

Use the useMeteorControl hook to trigger, stop, and reset the meteor animation programmatically. The hook also exposes the current phase (falling, impact, fading, idle).

Properties

PropertyTypeDefaultDescription
idstringrequiredUnique identifier for the meteor effect
target[number, number]requiredImpact point coordinates [longitude, latitude]
sizenumber300Canvas size in pixels
anglenumber45Travel direction in degrees (45 = falling from upper-left)
speednumber2000Fall duration in milliseconds
intensitynumber1Overall power multiplier affecting size, tail, and impact
meteorColorstring#ffaa00Core meteor color (hex)
trailColorstring#ff6600Trail particle color (hex)
impactColorstring#ffdd00Impact flash color (hex)
tailLengthnumber0.4Tail length as fraction of size (0-1)
meteorSizenumber8Meteor core radius in pixels
impactSizenumber0.3Impact flash radius as fraction of size
autoStartbooleantrueStart animation on mount
loopbooleanfalseRepeat the meteor animation
loopDelaynumber2000Delay in ms between loops
showerbooleanfalseEnable meteor shower mode
showerCountnumber4Number of meteors in shower mode

Use Cases

Impact Events

Visualize meteor strikes or impact craters

Gaming Maps

Add dramatic meteor effects to game worlds