
Product
Introducing Repository Access Permissions and Custom Roles
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.
@vnedyalk0v/react19-simple-maps
Advanced tools
An svg map chart component built exclusively for React 19+ - Modern TypeScript-first library with cutting-edge React patterns
Create interactive SVG maps in React with d3-geo and topojson using a TypeScript-first API for React 19+.
Modernized fork of react-simple-maps with React 19 support and TypeScript-first tooling.
debug prop or REACT_SIMPLE_MAPS_DEBUG# npm
npm install @vnedyalk0v/react19-simple-maps
# yarn
yarn add @vnedyalk0v/react19-simple-maps
# pnpm
pnpm add @vnedyalk0v/react19-simple-maps
ESM-only: This package only supports
importsyntax.require(...)is not supported.
You can import helper utilities directly from the ./utils subpath:
import {
validateGeographyUrl,
configureSRI,
} from '@vnedyalk0v/react19-simple-maps/utils';
react-simple-maps → @vnedyalk0v/react19-simple-maps.createCoordinates() (or an explicit cast) for Coordinates.(event, data) where data includes geography info (centroid, bounds, etc.).import React from 'react';
import {
ComposableMap,
Geographies,
Geography,
createCoordinates,
} from '@vnedyalk0v/react19-simple-maps';
const geoUrl = 'https://unpkg.com/world-atlas@2.0.2/countries-110m.json';
const MapChart = () => {
return (
<ComposableMap
projection="geoEqualEarth"
projectionConfig={{
scale: 147,
center: createCoordinates(0, 0),
}}
width={800}
height={500}
>
<Geographies geography={geoUrl}>
{({ geographies }) =>
geographies.map((geo) => (
<Geography
key={geo.rsmKey}
geography={geo}
style={{
default: { fill: '#D6D6DA', outline: 'none' },
hover: { fill: '#F53', outline: 'none' },
pressed: { fill: '#E42', outline: 'none' },
}}
/>
))
}
</Geographies>
</ComposableMap>
);
};
export default MapChart;
The main wrapper component that provides SVG context and projection setup.
Common props:
projection - Map projection (string name or d3-geo projection function)projectionConfig - Configuration for built-in projectionswidth, height - SVG dimensionsclassName - CSS class namedebug - Enable opt-in debug logging (default: false)Renders geographic features from TopoJSON or GeoJSON data.
Notable props:
geography - URL string, TopoJSON object, or GeoJSON FeatureCollectionparseGeographies - Optional function to transform geography dataerrorBoundary - Enable built-in error boundary and Suspense fallbackonGeographyError, fallback - Error handling hooks when errorBoundary is enabledIndividual geographic feature component with enhanced event handlers.
All event handlers receive (event, GeographyEventData) where GeographyEventData includes:
geography, centroid, bounds, and coordinates.
Zoom and pan with both simple and advanced APIs.
import {
ZoomableGroup,
createZoomConfig,
} from '@vnedyalk0v/react19-simple-maps';
<ZoomableGroup
zoom={1}
center={createCoordinates(0, 0)}
{...createZoomConfig(0.5, 8)}
>
{/* Content */}
</ZoomableGroup>;
Use Marker for custom points and Annotation for callouts.
Line - Draw lines between coordinatesGraticule - Add coordinate grid linesSphere - Add map outline/backgroundGeographyErrorBoundary - Explicit error boundary wrapperMapWithMetadata - Wrapper that renders metadata and a ComposableMapBranded types help prevent coordinate mistakes:
import {
createCoordinates,
createLongitude,
createLatitude,
} from '@vnedyalk0v/react19-simple-maps';
const lon = createLongitude(-74.006);
const lat = createLatitude(40.7128);
const coords = createCoordinates(-74.006, 40.7128);
Extract geographic data for interactions and labels:
import {
getGeographyCentroid,
getGeographyBounds,
getBestGeographyCoordinates,
} from '@vnedyalk0v/react19-simple-maps';
The ./utils subpath includes helpers for safer geography fetching. When you use URL-based geography data in Geographies, the internal fetch path applies URL validation, HTTPS-only defaults, resolved-hostname checks in server environments, response size checks, and optional SRI validation.
import {
configureGeographySecurity,
enableDevelopmentMode,
} from '@vnedyalk0v/react19-simple-maps/utils';
configureGeographySecurity({
TIMEOUT_MS: 5000,
MAX_RESPONSE_SIZE: 10 * 1024 * 1024,
});
if (process.env.NODE_ENV === 'development') {
enableDevelopmentMode(true); // allow HTTP localhost
}
In production, the fetch path keeps HTTPS-only protections enabled and does not disable integrity checks for known geography sources.
Enable debug logging globally via environment variable or per map:
REACT_SIMPLE_MAPS_DEBUG=true
<ComposableMap debug={true}>{/* Map content */}</ComposableMap>
npm install
npm run dev
npm run build
npm run test
npm run type-check
npm run lint
Changesets is configured for versioning and releases. The GitHub Actions workflow in .github/workflows/publish.yml runs on pushes to main and publishes to npm when configured with the required token.
MIT licensed. Original work Copyright (c) Richard Zimerman 2017. Fork maintenance Copyright (c) Georgi Nedyalkov 2025. See LICENSE for details.
FAQs
An svg map chart component built exclusively for React 19+ - Modern TypeScript-first library with cutting-edge React patterns
The npm package @vnedyalk0v/react19-simple-maps receives a total of 8,366 weekly downloads. As such, @vnedyalk0v/react19-simple-maps popularity was classified as popular.
We found that @vnedyalk0v/react19-simple-maps demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.

Product
Socket Firewall blocks malicious VS Code and Open VSX extensions before install, protecting developers from compromised editor marketplaces.