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

Radar

97.14% covered

Animated radar sweep signal overlay on map coordinates.

Installation

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

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

Then install the radar component:

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

Custom Colors

Use color, gridColor, and backgroundColor to theme each radar independently.

Sweep Speed

Control the rotation speed with duration. Lower values create a faster sweep, higher values create a slower, more deliberate rotation.

Range Rings

Set rings to control the number of concentric range rings displayed on the radar.

No Crosshairs

Set showCrosshairs to false to hide the horizontal and vertical crosshair lines for a cleaner look.

Properties

PropTypeDescription
coordinates[number, number]Position [longitude, latitude] for the radar center.
sizenumberRadar diameter in pixels.
colorstringPrimary color for the sweep line, center dot, and outer ring.
gridColorstringColor of the concentric rings and crosshair lines.
backgroundColorstringBackground fill color of the radar circle.
durationnumberTime in milliseconds for one full sweep rotation.
ringsnumberNumber of concentric range rings.
showCrosshairsbooleanShow the horizontal and vertical crosshair lines.
pitchAlignmentNew"map" | "viewport" | "auto"Controls how the radar is aligned when the map is pitched. Use "viewport" to keep the radar facing the screen.

Performance Considerations

  • The radar uses CSS animations and SVG — lightweight and GPU-accelerated
  • Multiple radars on screen have minimal performance impact
  • Animation automatically stops when the component unmounts