Installation
Usage
Examples
Basic World Map
With Location Markers
Custom Marker Sizes
High-Resolution Map
Custom Colors
Without Staggering
Props
The width of the SVG viewBox.
The height of the SVG viewBox.
The number of dots to render on the map. Higher values create a more detailed map but may impact performance.
Array of marker objects to display on the map. Each marker should have:
lat(number, required) - Latitude coordinatelng(number, required) - Longitude coordinatesize(number, optional) - Radius of the marker dot
The color of the map dots. Supports CSS color values.
The color of the location markers.
The radius of each dot on the map.
Whether to apply staggered positioning to alternating rows. Creates a more organic, hexagonal-like pattern.
Additional CSS classes to apply to the SVG element.
Inline CSS styles to apply to the SVG element.
Features
- SVG-based world map rendered with dots
- Customizable dot density and size
- Support for location markers with coordinates
- Marker size customization
- Staggered row positioning for organic appearance
- Fully customizable colors
- Responsive design (scales to container)
- Lightweight and performant
Marker Object Type
Performance Considerations
- The
mapSamplesprop directly affects the number of DOM elements rendered - For better performance on lower-end devices, reduce
mapSamplesto 3000-4000 - For high-quality displays, increase to 8000-10000
- Default value of 5000 provides a good balance
Dependencies
- svg-dotted-map (for map generation and marker positioning)
Use Cases
- Display global office locations
- Show service coverage areas
- Visualize user distribution
- Highlight travel destinations
- Display data center locations
- Show shipping routes or delivery zones