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

Fire

Realistic animated fire effect with particle simulation.

Installation

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

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

Then install the fire component:

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

Intensity

Control the fire intensity with the intensity prop. Higher values create larger, more vigorous flames with wider particle spread. Combine with size to create fires of different scales.

Custom Colors

Customize the flame colors with baseColor (bottom of flame) and tipColor (top of flame). Create magical blue flames, green toxic fires, or any color combination.

Spreading Fire

Enable spread to simulate fire spreading across an area, like a forest fire. Control the spread behavior with spreadSpeed (time between new fire sources), spreadRadius (how far fire spreads), and maxSpreadPoints (maximum number of fire points).

Properties

PropertyTypeDefaultDescription
idstringrequiredUnique identifier for the fire effect
coordinates[number, number]requiredFire location as [longitude, latitude]
sizenumber120Fire size in pixels
intensitynumber1Fire intensity (affects spread and velocity)
particleCountnumber50Number of fire particles
baseColorstring#ffcc00Base flame color (bottom)
tipColorstring#ff3300Tip flame color (top)
spreadbooleanfalseEnable fire spreading behavior
spreadSpeednumber2000Time in ms between new fire points
spreadRadiusnumber0.4Spread radius as fraction of size (0-1)
maxSpreadPointsnumber8Maximum number of fire sources
autoStartbooleantrueStart animation on mount

Use Cases

Wildfire Visualization

Display active wildfire locations on emergency maps

Gaming Maps

Add fire effects to game world maps and battle scenes