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

Animated Circle

Animated circles with drawing outline and fill effects.

Installation

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

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

Then install the animated circle component:

npx shadcn@latest add https://www.terrae.dev/animated-circle.json

Dashed

Use strokeDashArray to create a dashed outline effect.

Fill

Set animationMode="fill" to animate the fill opacity instead of the outline.

Looping Animation

Enable loop to continuously repeat the animation. Use loopDelay to control the pause between iterations.

Sequential Concentric Circles

Use onComplete callbacks to chain animations. This example animates circles from inner to outer, creating an expanding ripple effect.

Properties

PropertyTypeDefaultDescription
idstringrequiredUnique identifier for the animated circle
center[number, number]requiredCenter point [longitude, latitude] of the circle
radiusnumberrequiredRadius of the circle in meters
strokeColorstring"#3b82f6"Stroke/outline color
strokeWidthnumber2Stroke width in pixels
strokeOpacitynumber1Stroke opacity (0-1)
strokeDashArraynumber[]-Dash pattern [dash, gap] for dashed outline
fillColorstring"#3b82f6"Fill color of the circle
fillOpacitynumber0.3Target fill opacity (0-1)
durationnumber2000Outline drawing duration in milliseconds
fillDurationnumber1000Fill animation duration in milliseconds
animationMode"draw" | "fill""draw"Animation mode: outline only or outline then fill
autoStartbooleantrueStart animation automatically on mount
loopbooleanfalseLoop the animation continuously
loopDelaynumber1000Delay before restarting loop in milliseconds
segmentsnumber64Number of segments for circle smoothness
onDrawComplete() => void-Callback when outline drawing completes
onFillComplete() => void-Callback when fill animation completes
onComplete() => void-Callback when entire animation completes

Use Cases

Expanding Search

Visualize search radius expanding from a point

Impact Visualization

Animate blast radius or impact zones