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

Reference

Complete reference for all map components and their props.

Tip: This library supports both Mapbox GL JS and MapLibre GL JS. Most components extend native map options. Refer to the Mapbox Map API or MapLibre API for additional configuration options.

Component Anatomy

All components you can use and combine to build your map.

<Map>
  {/* Markers */}
  <MapMarker coordinates={[lng, lat]}>
    <MarkerContent>
      <MarkerLabel />
      <MarkerAvatar src="..." />
      <MarkerAvatarPin src="..." />
    </MarkerContent>
    <MarkerPopup />
    <MarkerTooltip />
  </MapMarker>
  <MapMarkerAnimated id="animated" path={[[lng, lat], ...]} />

  {/* Popup */}
  <MapPopup coordinates={[lng, lat]} />

  {/* Controls */}
  <MapControls position="bottom-right">
    <MapZoom />
    <MapOrientation />
    <MapGeolocate />
    <MapFullscreen />
  </MapControls>
  <MapCompass />

  {/* Features */}
  <MapMiniMap />
  <MapLine coordinates={[[lng, lat], ...]} />
  <MapPolygon coordinates={[[lng, lat], ...]} />
  <MapCircle center={[lng, lat]} radius={1000} />
  <MapAnimatedCircle id="zone" center={[lng, lat]} radius={1000} />
  <MapLineAnimated id="route" path={[[lng, lat], ...]} />
  <MapLineRadial id="radial" origin={[lng, lat]} destinations={[[lng, lat], ...]} />
  <MapArcAnimated id="arc" origin={[lng, lat]} destination={[lng, lat]} />
  <MapCameraFollow path={[[lng, lat], ...]} />
  <MapAnimatedPolygon id="zone" coordinates={[[lng, lat], ...]} />
  <MapCircleCluster data={geoJsonData} />
  <MapChoropleth data={geoJsonData} valueProperty="density" colorScale={colorScale} />
  <MapAnimatedPulse id="pulse" size={100} coordinates={[lng, lat]} />
  <MapImage id="overlay" url="..." coordinates={[...]} />
  <MapRasterVideo id="video" urls={[...]} coordinates={[...]} />
  <MapBlurArea coordinates={[[lng, lat], ...]} />
  <MapTargetingReticle coordinates={[lng, lat]} />
  <MapRain />
  <MapSnow />
  <MapSandstorm />

  {/* Effects */}
  <MapFire id="fire" coordinates={[lng, lat]} />
  <MapExplosion id="explosion" coordinates={[lng, lat]} />
  <MapCyclone id="cyclone" coordinates={[lng, lat]} />
  <MapMeteor id="meteor" target={[lng, lat]} />
  <MapLightning id="lightning" coordinates={[lng, lat]} />
  <MapSteam id="steam" coordinates={[lng, lat]} />
  <MapTsunami id="tsunami" origin={[lng, lat]} target={[lng, lat]} />

  {/* Overlays */}
  <MapMusicDisc coordinates={[lng, lat]} />
  <MapAnimatedFootprint path={[[lng, lat], ...]} />
  <MapGrid />
  <MapRadar id="radar" coordinates={[lng, lat]} />
  <MapWatermark>TEXT</MapWatermark>
</Map>

Map

The root container that initializes the map and provides context to all child components. Supports both Mapbox GL JS and MapLibre GL JS. Automatically handles theme switching between light and dark modes.

Extends MapOptions from Mapbox GL (excluding container and style).

PropTypeDescription
accessTokenstringMapbox access token. Required.
childrenReactNodeChild components (markers, popups, controls, features).
center[number, number]Initial map center [longitude, latitude].
zoomnumberInitial zoom level.
bearingnumberMap bearing (rotation) in degrees.
pitchnumberMap pitch (tilt) in degrees.
projectionstringMap projection: mercator, globe, albers, equalEarth, equirectangular, lambertConformalConic, naturalEarth, winkelTripel.
stylestringMap style URL (e.g., 'mapbox://styles/mapbox/streets-v12'). Overrides theme-based styles.
stylesMapThemeStylesTheme-aware styles object. Use presets: defaultMapStyles, standardMapStyles, streetsMapStyles, outdoorsMapStyles, satelliteMapStyles, navigationMapStyles.
minZoomnumberMinimum zoom level constraint.
maxZoomnumberMaximum zoom level constraint.
maxBounds[[number, number], [number, number]]Restrict map panning to a geographic area [southwest, northeast].
loaderReactNodeCustom loading component shown while map initializes.
showLoaderbooleanControls loader visibility. When true, forces loader. When false, hides. When undefined, uses internal loading state.
autoRotatebooleanEnables automatic rotation. Only works with projection="globe".
rotateSpeednumberRotation speed in degrees per second when autoRotate is enabled.

MapControls

Container for map control components. Accepts composable control components as children (MapZoom, MapOrientation, MapGeolocate, MapFullscreen). Must be used inside Map.

PropTypeDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right"Position of the controls on the map.
childrenReactNodeControl components (MapZoom, MapOrientation, MapGeolocate, MapFullscreen).
classNamestringAdditional CSS classes for the controls container.

MapZoom

Zoom in and zoom out control buttons. Must be used inside MapControls.

No props required.

MapOrientation

Compass control that shows map orientation and resets bearing to north when clicked. Must be used inside MapControls.

No props required.

MapGeolocate

Geolocate control to find and fly to user's current location. Must be used inside MapControls.

PropTypeDescription
onLocate(coords: { longitude: number; latitude: number }) => voidCallback with user coordinates when located.

MapFullscreen

Fullscreen toggle control. Must be used inside MapControls.

No props required.

MapCompass

Interactive compass with drag-to-rotate functionality. Dragging the compass rotates the map bearing. Must be used inside Map.

PropTypeDescription
size"sm" | "md" | "lg" | "xl" | numberCompass size. T-shirt sizes map to 48, 64, 80, 96 pixels respectively.
position"top-left" | "top-right" | "bottom-left" | "bottom-right"Position of the compass on the map.
showCardinalsbooleanShow N, S, E, W cardinal direction labels.
showRingbooleanShow outer ring with degree tick marks.
showBearingbooleanDisplay current bearing in degrees below the compass.
autoRotatebooleanEnable automatic rotation of the compass.
autoRotateSpeednumberSpeed of auto rotation in degrees per frame.
classNamestringAdditional CSS classes for the wrapper element.

MapMarker

A container for marker-related components. Provides context for its children and handles marker positioning.

Extends MarkerOptions from Mapbox GL (excluding element).

PropTypeDescription
coordinates[number, number]Coordinates [longitude, latitude] for marker position.
childrenReactNodeMarker subcomponents (MarkerContent, MarkerPopup, etc).
onClick(e: MouseEvent) => voidCallback when marker is clicked.
onMouseEnter(e: MouseEvent) => voidCallback when mouse enters marker.
onMouseLeave(e: MouseEvent) => voidCallback when mouse leaves marker.
onDragStart(lngLat: LngLatCoordinates) => voidCallback when marker drag starts (requires draggable: true).
onDrag(lngLat: LngLatCoordinates) => voidCallback during marker drag (requires draggable: true).
onDragEnd(lngLat: LngLatCoordinates) => voidCallback when marker drag ends (requires draggable: true).

MarkerContent

Renders the visual content of a marker. Must be used inside MapMarker. If no children provided, renders a default blue dot marker.

PropTypeDescription
childrenReactNodeCustom marker content. Defaults to a blue dot.
classNamestringAdditional CSS classes for the marker container.

MarkerPopup

Renders a popup attached to the marker that opens on click. Must be used inside MapMarker.

Extends PopupOptions from Mapbox GL (excluding className and closeButton).

The className and closeButton from Mapbox's PopupOptions are excluded to prevent style conflicts. Use the component's own props to style the popup. Mapbox's default popup styles are reset via CSS.
PropTypeDescription
childrenReactNodePopup content.
classNamestringAdditional CSS classes for the popup container.
closeButtonbooleanShow a close button in the popup.

MarkerTooltip

Renders a tooltip that appears on hover. Must be used inside MapMarker.

Extends PopupOptions from Mapbox GL (excluding className, closeButton, and closeOnClick as tooltips auto-dismiss on hover out).

The className from Mapbox's PopupOptions is excluded to prevent style conflicts. Use the component's own className prop to style the tooltip content. Mapbox's default popup styles are reset via CSS.
PropTypeDescription
childrenReactNodeTooltip content.
classNamestringAdditional CSS classes for the tooltip container.

MarkerLabel

Renders a text label above or below the marker. Must be used inside MarkerContent.

PropTypeDescription
childrenReactNodeLabel text content.
classNamestringAdditional CSS classes for the label.
position"top" | "bottom"Position of the label relative to the marker.

MapPopup

A standalone popup component that can be placed anywhere on the map without a marker. Must be used inside Map.

Extends PopupOptions from Mapbox GL (excluding className and closeButton).

The className and closeButton from Mapbox's PopupOptions are excluded to prevent style conflicts. Use the component's own props to style the popup. Mapbox's default popup styles are reset via CSS.
PropTypeDescription
coordinates[number, number]Coordinates [longitude, latitude] for popup position.
onClose() => voidCallback when popup is closed.
childrenReactNodePopup content.
classNamestringAdditional CSS classes for the popup container.
closeButtonbooleanShow a close button in the popup.

MapMarkerAnimated

Renders an animated marker that moves along a path. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the animated marker.
coordinates[number, number][]Array of [longitude, latitude] pairs defining the path.
colorstringMarker color.
sizenumberMarker radius in pixels.
durationnumberAnimation duration in milliseconds.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop animation continuously.
showPathbooleanShow the path/route line.
pathColorstringPath line color.
pathWidthnumberPath line width in pixels.
onComplete() => voidCallback when animation completes.

MapLine

Renders a line on the map connecting coordinate points. Must be used inside Map.

PropTypeDescription
coordinates[number, number][]Array of [longitude, latitude] coordinate pairs.
colorstringLine color (CSS color value).
widthnumberLine width in pixels.
opacitynumberLine opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed lines.

MapPolygon

Renders a filled polygon on the map. Must be used inside Map.

PropTypeDescription
coordinates[number, number][]Array of [longitude, latitude] coordinate pairs defining the polygon vertices.
fillColorstringFill color of the polygon.
fillOpacitynumberFill opacity (0 to 1).
strokeColorstringStroke/outline color.
strokeWidthnumberStroke width in pixels.
strokeOpacitynumberStroke opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed strokes.

MapCircle

Renders a geographic circle on the map with a center point and radius in meters. Must be used inside Map.

PropTypeDescription
center[number, number]Center point [longitude, latitude] of the circle.
radiusnumberRadius of the circle in meters.
fillColorstringFill color of the circle.
fillOpacitynumberFill opacity (0 to 1).
strokeColorstringStroke/outline color.
strokeWidthnumberStroke width in pixels.
strokeOpacitynumberStroke opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed strokes.
segmentsnumberNumber of segments for circle smoothness.
draggablebooleanEnable dragging to reposition the circle.
cursorstringCursor style when hovering over draggable circle.
onDragStart(center: [number, number]) => voidCallback when drag begins.
onDrag(center: [number, number]) => voidCallback during drag with new center coordinates.
onDragEnd(center: [number, number]) => voidCallback when drag ends with final center coordinates.

MapAnimatedCircle

Renders an animated circle with drawing outline and fill effects. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the animated circle.
center[number, number]Center point [longitude, latitude] of the circle.
radiusnumberRadius of the circle in meters.
strokeColorstringColor of the circle outline.
strokeWidthnumberWidth of the circle outline in pixels.
strokeOpacitynumberOpacity of the circle outline (0-1).
strokeDashArraynumber[]Dash pattern [dash, gap] for dashed outline effect.
fillColorstringColor of the circle fill.
fillOpacitynumberTarget opacity of the circle fill (0-1).
durationnumberDuration of outline drawing animation in milliseconds.
fillDurationnumberDuration of fill animation in milliseconds.
animationMode"draw" | "fill"Animation mode: outline only or outline then fill.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the animation continuously.
loopDelaynumberDelay before restarting loop in milliseconds.
segmentsnumberNumber of segments for circle smoothness.
onDrawComplete() => voidCallback when outline drawing completes.
onFillComplete() => voidCallback when fill animation completes.
onComplete() => voidCallback when entire animation completes.

MapCircleCluster

Renders clustered point data using Mapbox GL's native clustering. Automatically groups nearby points into clusters that expand on click. Must be used inside Map. Supports a generic type parameter for typed feature properties: MapCircleCluster<MyProperties>.

PropTypeDescription
datastring | GeoJSON.FeatureCollectionGeoJSON FeatureCollection data or URL to fetch GeoJSON from.
clusterMaxZoomnumberMaximum zoom level to cluster points on.
clusterRadiusnumberRadius of each cluster when clustering points (in pixels).
clusterColors[string, string, string]Colors for cluster circles: [small, medium, large] based on point count.
clusterThresholds[number, number]Point count thresholds for color/size steps: [medium, large].
pointColorstringColor for unclustered individual points.
onPointClick(feature: GeoJSON.Feature, coordinates: [number, number]) => voidCallback when an unclustered point is clicked.
onClusterClick(clusterId: number, coordinates: [number, number], pointCount: number) => voidCallback when a cluster is clicked. If not provided, zooms into the cluster.

MapChoropleth

Colors geographic regions based on data values. Supports GeoJSON data with Polygon or MultiPolygon features. Must be used inside Map. Supports a generic type parameter for typed feature properties: MapChoropleth<MyProperties>.

PropTypeDescription
datastring | GeoJSON.FeatureCollectionGeoJSON URL or FeatureCollection with Polygon/MultiPolygon features.
valuePropertystringProperty name in feature.properties to use for coloring.
colorScaleChoroplethColorScaleColor scale configuration: { stops: [{ value, color }], interpolation?: 'linear' | 'step', nullColor? }.
fillOpacitynumberFill opacity (0-1).
strokeColorstringBorder color between regions.
strokeWidthnumberBorder width in pixels.
strokeOpacitynumberBorder opacity (0-1).
hoverEnabledbooleanEnable hover highlighting effect.
hoverFillOpacitynumberFill opacity when hovered.
hoverStrokeColorstringBorder color when hovered.
hoverStrokeWidthnumberBorder width when hovered.
onClick(event: ChoroplethClickEvent) => voidCallback when a region is clicked. Event includes feature, value, and coordinates.
onHover(event: ChoroplethHoverEvent) => voidCallback when hovering over regions. Event includes feature, value, and coordinates.

MapAnimatedPulse

Renders an animated pulsing dot at specified coordinates. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the pulse animation.
sizenumberPulse size in pixels.
coordinates[number, number]Coordinates [longitude, latitude] for pulse position.
colorstringInner circle color.
pulseColorstringOuter pulsing circle color.
durationnumberAnimation duration in milliseconds.

MapAnimatedPolygon

Renders an animated polygon with drawing outline and fill effects. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the polygon.
coordinates[number, number][]Array of [longitude, latitude] pairs defining polygon vertices.
strokeColorstringColor of the polygon outline.
strokeWidthnumberWidth of the polygon outline in pixels.
strokeOpacitynumberOpacity of the polygon outline (0-1).
fillColorstringColor of the polygon fill.
fillOpacitynumberTarget opacity of the polygon fill (0-1).
durationnumberDuration of outline drawing animation in milliseconds.
fillDurationnumberDuration of fill animation in milliseconds.
animationMode"draw" | "fill" | "draw-then-fill"Animation sequence mode.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the animation continuously.
loopDelaynumberDelay before restarting loop in milliseconds.
onDrawComplete() => voidCallback when outline drawing completes.
onFillComplete() => voidCallback when fill animation completes.
onComplete() => voidCallback when entire animation completes.

MapMiniMap

Displays an overview minimap showing the current viewport context. Must be used inside Map.

PropTypeDescription
position"top-left" | "top-right" | "bottom-left" | "bottom-right"Position of the minimap on the map.
widthnumberMinimap width in pixels.
heightnumberMinimap height in pixels.
zoomOffsetnumberZoom offset relative to main map.
stylestringCustom map style URL for the minimap. Overrides theme-based styles.
stylesMapThemeStylesTheme-aware styles object with light/dark variants. Automatically switches based on theme.
boxColorstringColor of the viewport box outline.
boxBorderWidthnumberWidth of the viewport box border.
roundednumber | "full" | "none"Border radius in pixels, "full" for circular, or "none".
draggablebooleanAllow users to drag the minimap anywhere within the map.

MapBlurArea

Renders blur effect overlays on specified areas of the map. Supports single or multiple areas. Must be used inside Map.

PropTypeDescription
coordinates[number, number][]Array of [longitude, latitude] coordinate pairs defining a single blur area.
areasBlurAreaConfig[]Array of blur area configs for multiple regions. Each config: { coordinates, blur?, backgroundColor?, rounded? }.
blurnumberDefault blur intensity in pixels.
backgroundColorstringDefault background color overlay (e.g., "rgba(0,0,0,0.3)").
roundednumber | "full"Default border radius in pixels or "full" for circular.
blockInteractionbooleanPrevent map interactions on blur areas.

MapTargetingReticle

Renders a targeting reticle overlay with corner brackets that can track and lock onto targets. Must be used inside Map.

PropTypeDescription
coordinates[number, number]Current reticle position [longitude, latitude].
target[number, number]Target coordinates to track towards.
sizenumberReticle size in pixels.
bracketLengthnumberLength of corner brackets in pixels.
bracketThicknessnumberThickness of corner brackets in pixels.
gapnumberGap between brackets and reticle edge in pixels.
colorstringDefault reticle color.
lockedColorstringColor when locked on target.
lockedbooleanWhether the reticle is locked on target.
trackingSpeednumberSpeed of tracking interpolation (0-1).
showCrosshairbooleanShow crosshair lines in the center.
showCoordinatesbooleanDisplay coordinates below the reticle.
onLocked() => voidCallback when reticle locks onto target.

MapLineAnimated

Renders an animated line that draws progressively along the route. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the animated line.
pathArray<[number, number]>Array of [longitude, latitude] coordinate pairs.
colorstringLine color.
widthnumberLine width in pixels.
opacitynumberLine opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed lines.
durationnumberAnimation duration in milliseconds.
showMarkerbooleanWhether to show a marker moving along the line.
markerColorstringMarker color.
markerIconReactNodeCustom marker icon (React component).
markerBorderlessbooleanRemove border/outline from marker.
autoStartbooleanAuto-start animation on mount.
loopbooleanLoop animation continuously.
onComplete() => voidCallback when animation completes.

MapLineRadial

Renders animated curved lines spreading from a central origin to multiple destinations. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the radial lines.
origin[number, number]Origin coordinates [longitude, latitude].
destinationsRadialDestination[]Array of destinations. Each can be [lng, lat] or { coordinates, color?, label? }.
colorstringDefault line color.
widthnumberLine width in pixels.
opacitynumberLine opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed lines.
curvaturenumber | "auto"Curve intensity (0-1) or "auto" to calculate based on distance.
curveSegmentsnumberNumber of segments for smooth curves.
durationnumberAnimation duration per line in milliseconds.
staggerDelaynumberDelay between starting each line animation.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the animation continuously.
loopDelaynumberDelay before restarting loop in milliseconds.
showOriginMarkerbooleanShow marker at origin point.
originMarkerColorstringOrigin marker color.
originMarkerIconReactNodeCustom origin marker icon.
originMarkerPulsebooleanShow pulse animation on origin marker.
showDestinationMarkersbooleanShow markers at destination points.
destinationMarkerColorstringDestination marker color (defaults to line color).
destinationMarkerIconReactNodeCustom destination marker icon.
showTravelingMarkerbooleanShow marker traveling along the active line.
travelingMarkerColorstringTraveling marker color (defaults to line color).
travelingMarkerIconReactNodeCustom traveling marker icon.
onLineComplete(index: number, destination: [number, number]) => voidCallback when a line animation completes.
onComplete() => voidCallback when all line animations complete.

MapArcAnimated

Renders an animated curved arc between two points. Useful for visualizing flights, deliveries, and point-to-point connections. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the arc.
origin[number, number]Starting point coordinates [longitude, latitude].
destination[number, number]Ending point coordinates [longitude, latitude].
colorstringArc line color.
widthnumberLine width in pixels.
opacitynumberLine opacity (0 to 1).
dashArray[number, number]Dash pattern [dash length, gap length] for dashed arcs.
heightnumberCurve height multiplier (0 = straight line, higher = more curved).
segmentsnumberNumber of segments for curve smoothness.
durationnumberAnimation duration in milliseconds.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the animation continuously.
loopDelaynumberDelay before restarting loop in milliseconds.
headType"none" | "circle" | "square" | "arrow"Shape of the traveling marker at the arc tip.
headSizenumberSize of the head marker in pixels.
showOriginMarkerbooleanShow marker at the origin point.
originMarkerColorstringOrigin marker color (defaults to arc color).
showDestinationMarkerbooleanShow marker at destination when animation completes.
destinationMarkerColorstringDestination marker color (defaults to arc color).
onComplete() => voidCallback when animation completes.

MapCameraFollow

Animates the camera along a path of coordinates for immersive fly-through experiences. Must be used inside Map.

PropTypeDescription
path[number, number][]Array of [longitude, latitude] coordinates for the camera to follow. Required.
durationnumberAnimation duration in milliseconds.
zoomnumberCamera zoom level during flight.
pitchnumberCamera tilt angle (0-85 degrees).
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the animation continuously.
loopDelaynumberDelay before restarting loop in milliseconds.
onComplete() => voidCallback when animation completes.
markerboolean | ReactNodeNavigation marker. Use true for default arrow, or pass a custom React element.
markerSizenumberSize of the default navigation marker in pixels.

MapCompare

Displays two maps side-by-side for visual comparison. This component creates its own map instances and does not require a parent Map component.

PropTypeDescription
accessTokenstringMapbox access token. Required.
beforeStylestringMap style for the before (left/top) map.
afterStylestringMap style for the after (right/bottom) map.
center[number, number]Initial map center [longitude, latitude].
zoomnumberInitial zoom level.
bearingnumberMap bearing (rotation) in degrees.
pitchnumberMap pitch (tilt) in degrees.
projection"globe" | "mercator" | "naturalEarth" | "equalEarth" | "winkelTripel"Map projection type.
defaultSizenumberInitial split position as percentage (0-100).
orientation"horizontal" | "vertical"Compare layout direction. Horizontal shows left/right, vertical shows top/bottom.
showLabelsbooleanShow Before/After or Top/Bottom labels on each map panel.
loaderReactNodeCustom loading component.

MapSync

Displays 2 or 4 synchronized maps where panning, zooming, or rotating one map updates all others in real-time. This component creates its own map instances and does not require a parent Map component.

PropTypeDescription
accessTokenstringMapbox access token. Required.
mapsMapConfig[]Array of 2 or 4 map configurations. Each config: { style?, styles?, label? }.
layout"horizontal" | "vertical" | "grid"Layout arrangement. Grid requires 4 maps for a 2x2 layout.
center[number, number]Initial map center [longitude, latitude].
zoomnumberInitial zoom level.
bearingnumberMap bearing (rotation) in degrees.
pitchnumberMap pitch (tilt) in degrees.
projection"globe" | "mercator" | "naturalEarth" | "equalEarth" | "winkelTripel"Map projection type.
showLabelsbooleanShow labels on each map panel.
loaderReactNodeCustom loading component.

MapImage

Overlays an image on the map at specified coordinates. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the image layer.
urlstringImage URL to display.
coordinates[[number, number], [number, number], [number, number], [number, number]]Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft] as [lng, lat] pairs.
opacitynumberImage opacity (0 to 1).

MapRasterVideo

Overlays video content on the map at specified coordinates. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the video layer.
urlsstring[]Array of video URLs (provide multiple formats for browser compatibility).
coordinates[[number, number], [number, number], [number, number], [number, number]]Four corner coordinates [topLeft, topRight, bottomRight, bottomLeft] as [lng, lat] pairs.
opacitynumberVideo opacity (0 to 1).
autoplaybooleanAuto-play video on load.
loopbooleanLoop video playback.
mutedbooleanMute video audio.

MapRain

Adds an animated rain weather effect overlay to the map. Requires Mapbox GL JS v3.9 or higher. Must be used inside Map.

This component requires Mapbox GL JS v3.9+. Use the createZoomInterpolation helper to create zoom-based effects.
PropTypeDescription
densitynumber | any[]Rain density (0-1) or Mapbox expression for zoom-based density.
intensitynumberRain intensity (0-1).
colorstringRain droplet color.
opacitynumberRain opacity (0-1).
vignettenumber | any[]Vignette effect strength (0-1) or Mapbox expression.
vignetteColorstringVignette color.
direction[number, number]Wind direction [x, y].
dropletSize[number, number]Droplet size range [min, max].
distortionStrengthnumberDistortion strength (0-1).
centerThinningnumberCenter thinning effect (0 = full screen).

MapSnow

Adds an animated snowfall weather effect overlay to the map. Must be used inside Map.

PropTypeDescription
intensitynumberSnowfall intensity multiplier.
particleCountnumberNumber of snowflake particles.
colorstringSnowflake color.
windSpeednumberHorizontal wind speed affecting drift.
windDirectionnumberWind direction in degrees.
fallSpeednumberVertical fall speed multiplier.
autoStartbooleanStart animation automatically on mount.

MapSandstorm

Adds an atmospheric sandstorm effect with horizontal particle movement and reduced visibility. Must be used inside Map.

PropTypeDescription
intensitynumberSandstorm intensity multiplier.
particleCountnumberNumber of sand particles.
colorstringSand particle color.
windSpeednumberHorizontal wind speed.
windDirectionnumberWind direction in degrees.
visibilitynumberVisibility level (0 = no visibility, 1 = clear).
turbulencenumberTurbulence amount affecting particle movement.
autoStartbooleanStart animation automatically on mount.

MapFire

Renders a realistic animated fire effect with particle simulation at map coordinates. Must be used inside Map. Use useFireControl hook to control programmatically.

PropTypeDescription
idstringUnique identifier for the fire effect.
coordinates[number, number]Coordinates [longitude, latitude] for the fire position.
sizenumberFire canvas size in pixels.
intensitynumberFire intensity multiplier.
particleCountnumberNumber of fire particles.
baseColorstringBase flame color.
tipColorstringFlame tip color.
spreadbooleanEnable fire spreading to nearby points.
spreadSpeednumberTime between spread points in milliseconds.
spreadRadiusnumberMaximum spread radius as fraction of canvas size.
maxSpreadPointsnumberMaximum number of fire spread sources.
autoStartbooleanStart animation automatically on mount.

MapExplosion

Renders an animated explosion burst effect with radial particles and flash. Supports burst and nuclear types. Must be used inside Map. Use useExplosionControl hook to trigger programmatically.

PropTypeDescription
idstringUnique identifier for the explosion.
coordinates[number, number]Coordinates [longitude, latitude] for the explosion.
type"burst" | "nuclear"Explosion type. Nuclear creates a mushroom cloud effect.
sizenumberExplosion canvas size in pixels.
particleCountnumberNumber of explosion particles.
durationnumberExplosion duration in milliseconds.
coreColorstringCore flash color.
outerColorstringOuter explosion color.
autoStartbooleanTrigger explosion automatically on mount.
loopbooleanLoop the explosion animation.
loopDelaynumberDelay before restarting loop in milliseconds.

MapCyclone

Renders an animated cyclone funnel with swirling particles and debris. Supports movement along a path. Must be used inside Map. Use useCycloneControl hook to control programmatically.

PropTypeDescription
idstringUnique identifier for the cyclone.
coordinates[number, number]Coordinates [longitude, latitude] for the cyclone position.
path[number, number][]Optional path for the cyclone to travel along.
durationnumberDuration of path movement in milliseconds.
loopbooleanLoop the path movement.
sizenumberCyclone canvas size in pixels.
intensitynumberCyclone intensity multiplier.
scalenumberCyclone visual scale (0.2 to 2).
particleCountnumberNumber of swirling particles.
funnelColorstringFunnel particle color.
debrisColorstringDebris particle color.
rotationSpeednumberRotation speed multiplier.
autoStartbooleanStart animation automatically on mount.

MapMeteor

Renders animated meteors falling from sky with fiery trail and impact effect. Supports single or shower mode. Must be used inside Map. Use useMeteorControl hook to control programmatically.

PropTypeDescription
idstringUnique identifier for the meteor.
target[number, number]Impact coordinates [longitude, latitude].
sizenumberEffect canvas size in pixels.
anglenumberMeteor entry angle in degrees.
speednumberFall duration in milliseconds.
intensitynumberEffect intensity multiplier.
meteorColorstringMeteor body color.
trailColorstringMeteor trail color.
impactColorstringImpact flash color.
tailLengthnumberTail length as fraction of canvas size.
meteorSizenumberMeteor head radius in pixels.
impactSizenumberImpact radius as fraction of canvas size.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the meteor animation.
loopDelaynumberDelay before restarting loop in milliseconds.
showerbooleanEnable meteor shower mode with multiple meteors.
showerCountnumberNumber of meteors in shower mode.

MapLightning

Renders animated lightning bolt strikes with branching and flash effects. Must be used inside Map. Use useLightningControl hook to trigger strikes programmatically.

PropTypeDescription
idstringUnique identifier for the lightning.
coordinates[number, number]Coordinates [longitude, latitude] for the lightning strike zone.
sizenumberLightning canvas size in pixels.
boltColorstringLightning bolt color.
flashColorstringFlash illumination color.
flashIntensitynumberFlash brightness (0-1).
autoStrikebooleanEnable automatic periodic strikes.
strikeIntervalnumberInterval between auto-strikes in milliseconds.
boltWidthnumberMain bolt width in pixels.
branchProbabilitynumberProbability of branching at each segment (0-1).

MapSteam

Renders a rising steam effect with wispy particle animation. Must be used inside Map. Use useSteamControl hook to control programmatically.

PropTypeDescription
idstringUnique identifier for the steam effect.
coordinates[number, number]Coordinates [longitude, latitude] for the steam position.
sizenumberSteam canvas size in pixels.
intensitynumberSteam intensity multiplier.
particleCountnumberNumber of steam particles.
colorstringSteam particle color.
driftnumberHorizontal drift amount.
riseSpeednumberVertical rise speed multiplier.
autoStartbooleanStart animation automatically on mount.

MapTsunami

Renders an animated tsunami wave effect with incoming wave, crashing foam, and debris. Must be used inside Map. Use useTsunamiControl hook to control programmatically.

PropTypeDescription
idstringUnique identifier for the tsunami.
origin[number, number]Wave origin coordinates [longitude, latitude].
target[number, number]Wave target/impact coordinates [longitude, latitude].
sizenumberTsunami canvas size in pixels.
waveHeightnumberWave height as fraction of canvas size.
waveWidthnumberWave width as fraction of canvas size.
speednumberWave approach duration in milliseconds.
waterColorstringWave water color.
foamColorstringWave foam/crest color.
particleCountnumberNumber of foam and debris particles on crash.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the tsunami animation.
loopDelaynumberDelay before restarting loop in milliseconds.

MapMusicDisc

Renders a rotating vinyl disc with floating music notes at map coordinates. Must be used inside Map.

PropTypeDescription
coordinates[number, number]Coordinates [longitude, latitude] for disc position.
sizenumberDisc diameter in pixels.
imagestringAlbum cover image URL for the disc center.
spinningbooleanEnable disc rotation animation.
spinDurationnumberFull rotation duration in milliseconds.
showNotesbooleanShow floating music note animations.
noteColorstringMusic note color.
discColorstringDisc background color.
centerColorstringDisc center/label area color.
pitchAlignment"map" | "viewport" | "auto"How the disc aligns with the map pitch.
classNamestringAdditional CSS classes for the disc container.

MapAnimatedFootprint

Renders animated footprint steps that walk along a path on the map. Must be used inside Map.

PropTypeDescription
path[number, number][]Array of [longitude, latitude] pairs defining the walking path.
colorstringFootprint icon color.
sizenumberFootprint icon size in pixels.
stepSpacingnumberDistance between steps in meters.
staggerDelaynumberDelay between revealing each step in milliseconds.
durationnumberFade-in duration per step in milliseconds.
autoStartbooleanStart animation automatically on mount.
loopbooleanLoop the walking animation.
classNamestringAdditional CSS classes for each footprint element.

MapGrid

Renders a coordinate grid overlay with latitude/longitude lines and labels. Must be used inside Map.

PropTypeDescription
idstringUnique identifier prefix for grid sources and layers.
latitudeIntervalnumberDegrees between latitude lines.
longitudeIntervalnumberDegrees between longitude lines.
lineColorstringGrid line color.
lineOpacitynumberGrid line opacity (0-1).
lineWidthnumberGrid line width in pixels.
showLabelsbooleanShow coordinate labels at line intersections.
labelColorstringLabel text color.
labelSizenumberLabel font size in pixels.
labelBackgroundstringLabel background color.

MapRadar

Renders an animated radar sweep signal overlay at map coordinates. Must be used inside Map.

PropTypeDescription
idstringUnique identifier for the radar.
coordinates[number, number]Coordinates [longitude, latitude] for the radar position.
sizenumberRadar display size in pixels.
colorstringSweep and ring color.
gridColorstringGrid line color.
backgroundColorstringRadar background color.
durationnumberFull sweep rotation duration in milliseconds.
ringsnumberNumber of concentric range rings.
showCrosshairsbooleanShow crosshair lines through the center.

MapWatermark

Renders a text watermark overlay on the map with configurable position. Must be used inside Map.

PropTypeDescription
childrenReactNodeWatermark content (typically text).
position"center" | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "top" | "bottom" | "left" | "right"Watermark position on the map.
classNamestringCSS classes for styling. Defaults to large translucent text.

MarkerAvatar

Renders an avatar image with optional status indicator. Must be used inside MarkerContent.

PropTypeDescription
srcstringImage source URL.
altstringAlt text for the image.
sizenumberSize of the avatar in pixels.
onlinebooleanShow online status indicator.
statusColor"green" | "red" | "yellow" | "blue"Status indicator color.
classNamestringAdditional CSS classes for the avatar container.

MarkerAvatarPin

Renders an avatar inside a teardrop/pin shape that points to the exact location. Must be used inside MarkerContent.

PropTypeDescription
srcstringImage source URL.
altstringAlt text for the image.
sizenumberDiameter of the circular avatar in pixels.
borderWidthnumberBorder thickness in pixels.
classNamestringAdditional CSS classes for the pin container.

Helper Functions

createZoomInterpolation

Creates a Mapbox zoom-based interpolation expression for dynamic effects. Useful for rain density and vignette that scale with zoom level.

import { Map, MapRain, createZoomInterpolation } from "@/registry/map";

export function RainMapExample() {
  // Gradually increase rain density from zoom 11 to 13
  const density = createZoomInterpolation(0.8, 11, 13);
  const vignette = createZoomInterpolation(0.5, 11, 13);

  return (
    <Map
      accessToken={process.env.NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN!}
      center={[-74.006, 40.7128]}
      zoom={12}
    >
      <MapRain
        density={density}
        vignette={vignette}
        intensity={1.0}
        color="#a8adbc"
      />
    </Map>
  );
}