BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/terrae/radar

Map Radar

terrae/radar
FreeComponent

Animated radar sweep signal overlay on map coordinates.

Install it

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

Source

src/registry/map/radar.tsxwww.terrae.dev/radar.json · first 6 KB
1"use client"
2
3import { useEffect, useId, useRef, useState } from "react"
4import { createPortal } from "react-dom"
5import { mapgl } from "./map-library"
6import { useMap } from "./hooks"
7import type { MapCoordinates } from "./types"
8
9type RgbColor = { r: number; g: number; b: number }
10
11type MapRadarProps = {
12 coordinates: MapCoordinates
13 size?: number
14 color?: string
15 gridColor?: string
16 backgroundColor?: string
17 duration?: number
18 rings?: number
19 showCrosshairs?: boolean
20 pitchAlignment?: "map" | "viewport" | "auto"
21}
22
23type RadarContentProps = {
24 instanceId: string
25 size: number
26 color: string
27 gridColor: string
28 backgroundColor: string
29 duration: number
30 rings: number
31 showCrosshairs: boolean
32}
33
34type RadarGridProps = {
35 radius: number
36 gridColor: string
37 rings: number
38 showCrosshairs: boolean
39}
40
41type RadarSweepProps = {
42 instanceId: string
43 radius: number
44 color: string
45 duration: number
46}
47
48type SweepGradientProps = {
49 radius: number
50 sweepRadius: number
51 rgb: RgbColor
52}
53
54type SweepSegmentProps = {
55 radius: number
56 sweepRadius: number
57 rgb: RgbColor
58 segmentIndex: number
59}
60
61const DEFAULT_SIZE = 200
62const DEFAULT_COLOR = "rgba(0, 255, 70, 1)"
63const DEFAULT_GRID_COLOR = "rgba(0, 255, 70, 0.3)"
64const DEFAULT_BACKGROUND_COLOR = "rgba(0, 20, 0, 0.8)"
65const DEFAULT_DURATION = 2000
66const DEFAULT_RINGS = 4
67const DEFAULT_CROSSHAIRS = true
68const DEFAULT_PITCH_ALIGNMENT = "map" as const
69const SWEEP_SEGMENT_COUNT = 20
70const SWEEP_ARC = Math.PI / 2.5
71
72const createMarker = (
73 map: mapboxgl.Map,
74 container: HTMLDivElement,
75 coordinates: MapCoordinates,
76 pitchAlignment: "map" | "viewport" | "auto"
77) => {
78 return new mapgl.Marker({
79 element: container,
80 anchor: "center",
81 pitchAlignment,
82 })
83 .setLngLat(coordinates)
84 .addTo(map)
85}
86
87export const MapRadar = ({
88 coordinates,
89 size = DEFAULT_SIZE,
90 color = DEFAULT_COLOR,
91 gridColor = DEFAULT_GRID_COLOR,
92 backgroundColor = DEFAULT_BACKGROUND_COLOR,
93 duration = DEFAULT_DURATION,
94 rings = DEFAULT_RINGS,
95 showCrosshairs = DEFAULT_CROSSHAIRS,
96 pitchAlignment = DEFAULT_PITCH_ALIGNMENT,
97}: MapRadarProps) => {
98 const { map, isLoaded } = useMap()
99 const instanceId = useId()
100 const markerRef = useRef<mapboxgl.Marker | null>(null)
101 const containerRef = useRef<HTMLDivElement | null>(null)
102 const [isMounted, setIsMounted] = useState(false)
103
104 useEffect(() => {
105 if (!map || !isLoaded) {
106 return
107 }
108
109 const container = document.createElement("div")
110// … truncated

What it pulls in

npm packages

  • mapbox-gl

Other registry items

  • https://www.terrae.dev/map.json

Files it writes

  • src/registry/map/radar.tsx

Facts

Registry
terrae
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
In the index
at or before 2026-08-10
Last confirmed
yesterday

Go to the source

www.terrae.dev alamenai/terrae on GitHub Raw registry item This item as JSON

More from terrae

All 40 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Map Animated Circleanimated-circleterraeComponentsFree1 dep
Map Animated Footprintanimated-footprintterraeComponentsFree2 deps
Map Animated Polygonanimated-polygonterraeComponentsFree1 dep
Map Animated Pulseanimated-pulseterraeComponentsFree1 dep
Map Arc Animatedarc-animatedterraeComponentsFree1 dep
Map Blur Areablur-areaterraeComponentsFree1 dep
Map Camera Followcamera-followterraeComponentsFree1 dep
Map ChoroplethchoroplethterraeComponentsFree1 dep

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

KitGrade

SaaS starter kits, scored from measured facts

kitgrade.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and KitGrade

part of Toolproof, the measurement layer for AI agent tooling

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex