# react-simple-maps

> React components to build maps with d3-geo, with optional zoom/pan support

Latest version **5.0.5** (published 2026-09-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-simple-maps
pnpm add react-simple-maps
yarn add react-simple-maps
bun add react-simple-maps
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 5.0.5 |
| Published | 2026-09-12 |
| First published | 2017-03-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 10 |
| Unpacked size | 212.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3358 |
| Author | Richard Zimerman |
| Maintainers | zimrick |
| Keywords | react, maps, charts, worldmap, usa, d3-geo |

## Links

- npm: https://www.npmjs.com/package/react-simple-maps
- Repository: https://github.com/zcreativelabs/react-simple-maps
- Homepage: https://www.react-simple-maps.io/
- Issues: https://github.com/zcreativelabs/react-simple-maps/issues
- npm.io page: https://npm.io/package/react-simple-maps

## Dependencies (10)

- [d3-geo](https://npm.io/package/d3-geo.md) ^3.1.0
- [d3-zoom](https://npm.io/package/d3-zoom.md) ^3.0.0
- [d3-color](https://npm.io/package/d3-color.md) ^3.1.0
- [d3-selection](https://npm.io/package/d3-selection.md) ^3.0.0
- [@types/d3-geo](https://npm.io/package/@types/d3-geo.md) ^3.1.1
- [@types/d3-zoom](https://npm.io/package/@types/d3-zoom.md) ^3.0.8
- [@types/geojson](https://npm.io/package/@types/geojson.md) ^7946.0.13
- [d3-interpolate](https://npm.io/package/d3-interpolate.md) ^3.0.1
- [topojson-client](https://npm.io/package/topojson-client.md) ^3.1.0
- [@types/topojson-specification](https://npm.io/package/@types/topojson-specification.md) ^1.0.5

## Alternatives

- [d3-force-3d](https://npm.io/package/d3-force-3d.md) — 1.0M weekly downloads
- [ng2-charts](https://npm.io/package/ng2-charts.md) — 486.8K weekly downloads
- [@arcgis/core](https://npm.io/package/@arcgis/core.md) — 257.8K weekly downloads
- [react-sparklines](https://npm.io/package/react-sparklines.md) — 249.3K weekly downloads
- [react-native-gifted-charts](https://npm.io/package/react-native-gifted-charts.md) — 182.3K weekly downloads

## Recent versions

- 5.0.5 (latest) — 2026-09-12
- 5.0.3 (next) — 2026-09-07
- 4.0.0-beta.6 (beta) — 2023-07-01
- 5.0.4 — 2026-09-12
- 5.0.2 — 2026-09-06
- 5.0.1 — 2026-09-05
- 5.0.0 — 2026-08-28
- 4.0.0-beta.5 — 2023-07-01
- 4.0.0-beta.4 — 2023-07-01
- 4.0.0-beta.3 — 2023-07-01
- 4.0.0-beta.2 — 2023-07-01
- 4.0.0-beta.1 — 2023-07-01
- 4.0.0-beta.0 — 2023-07-01
- 3.0.0 — 2022-07-25
- 3.0.0-beta.8 — 2022-07-25
- … 45 more at https://npm.io/package/react-simple-maps/versions

## README

# React Simple Maps

![Version](https://img.shields.io/badge/version-5.0.5-%230066FF) ![License](https://img.shields.io/npm/l/react-simple-maps?color=%2328cb95) ![Coverage](https://img.shields.io/badge/coverage-99.8%25-brightgreen) ![Downloas](https://img.shields.io/npm/dw/react-simple-maps?color=%230066FF&label=downloads)

[![React simple maps cover image](./.github/react-simple-maps-cover.jpg)](https://www.react-simple-maps.io)

Compose map charts the same way you would write any other layout. Fully typed mature api with high test coverage, built on d3-geo and topojson.

Read the [docs](https://www.react-simple-maps.io/docs/getting-started/) to get started with React Simple Maps.

### Why

`React Simple Maps` aims to make working with svg maps in react easier. It handles tasks such as panning, zooming and simple rendering optimization, and takes advantage of parts of [d3-geo](https://github.com/d3/d3-geo) and topojson-client instead of relying on the entire d3 library.

Since `React Simple Maps` leaves DOM work to react, it also plays nicely with other react component libraries.

### Install

```bash
$ npm install react-simple-maps
```

### Usage

`React-simple-maps` exposes a set of components that can be combined to create svg maps with markers and annotations. In order to render a map you have to provide a reference to a valid TopoJSON file. You can find examples of TopoJSON files on the [react-simple-maps website](https://www.react-simple-maps.io/docs/map-files). To learn how to make your own topojson maps from shapefiles, please read ["How to convert and prepare TopoJSON files for interactive mapping with d3"](https://hackernoon.com/how-to-convert-and-prepare-topojson-files-for-interactive-mapping-with-d3-499cf0ced5f).

```jsx
import { ComposableMap, Geographies, Geography } from "react-simple-maps"

// url to a valid TopoJSON file
const geoUrl = "/path/to/my-topojson-file.json"

const SampleMap = () => {
  return (
    <ComposableMap>
      <Geographies geography={geoUrl}>
        {({ geographies }) =>
          geographies.map((geo) => (
            <Geography key={geo.rsmKey} geography={geo} />
          ))
        }
      </Geographies>
    </ComposableMap>
  )
}
```

The above will render a world map using the [equal earth projection](https://observablehq.com/@d3/equal-earth). You can read more about this projection on [Shaded Relief](http://shadedrelief.com/ee_proj/) and on [Wikipedia](https://en.wikipedia.org/wiki/Equal_Earth_projection).

### Map files

React-simple-maps does not restrict you to one specific map and relies on custom map files that you can modify in any way necessary for your project. This means that you can visualise countries, regions, and continents at various levels of complexity, as long as they can be represented using GeoJSON/TopoJSON.

In order for this to work properly, you will need to provide these valid map files to React Simple Maps yourself. Read our guide on [map files](https://www.react-simple-maps.io/docs/map-files). We also offer some testing files in the downloads section so you can get started quickly.

### V3 Docs

If you are using React Simple Maps v3, you can find the old documentation at [v3-react-simple-maps.io](https://v3.react-simple-maps.io/).

### License

MIT licensed. Copyright (c) Richard Zimerman 2017. See [LICENSE.md](https://github.com/zcreativelabs/react-simple-maps/blob/master/LICENSE) for more details.

---
_Source: https://npm.io/package/react-simple-maps · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
