New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react-dotted-map

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-dotted-map

A React component for displaying a dotted map.

latest
Source
npmnpm
Version
3.0.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

react-dotted-map

A lightweight React component for rendering beautiful, interactive dotted world maps as SVG.

npm version license

Installation

bun add react-dotted-map

Quick Start

import DottedMap from 'react-dotted-map';

function App() {
  return <DottedMap height={100} />;
}

Usage

Basic Map

import DottedMap from 'react-dotted-map';

function WorldMap() {
  return (
    <DottedMap
      height={100}
      className="my-map"
    />
  );
}

Adding Pins

Use the Pin component to mark locations on the map:

import DottedMap, { Pin } from 'react-dotted-map';

function MapWithPins() {
  return (
    <DottedMap height={100}>
      <Pin lat={40.7128} lng={-74.006} />  {/* New York */}
      <Pin lat={51.5074} lng={-0.1278} />  {/* London */}
      <Pin lat={35.6762} lng={139.6503} /> {/* Tokyo */}
    </DottedMap>
  );
}

Custom Pin Styling

Pins accept any valid SVG circle attributes:

<DottedMap height={100}>
  <Pin
    lat={48.8566}
    lng={2.3522}
    fill="red"
    stroke="white"
    strokeWidth={2}
  />
</DottedMap>

Filtering by Region

Display specific regions of the world:

<DottedMap
  height={100}
  region="EU" // Show only Europe
/>

Filtering by Countries

Show only specific countries:

<DottedMap
  height={100}
  countries={['USA', 'CAN', 'MEX']}
/>

API Reference

<DottedMap />

The main component for rendering the dotted map.

PropTypeDescription
heightnumberHeight of the map grid
widthnumberWidth of the map grid
regionstringFilter to show a specific region
countriesstring[]Array of country codes to display
gridstringGrid configuration
avoidOuterPinsbooleanAvoid placing dots at outer boundaries
classNamestringCSS class name for the SVG element
viewBoxstringSVG viewBox attribute
refRefObject<SVGSVGElement>React ref to the SVG element
childrenReactNodeChild elements (pins, custom SVG elements)

<Pin />

A component for adding location markers to the map.

PropTypeDescription
latnumberLatitude coordinate
lngnumberLongitude coordinate
...propsSVGCircleElementAny valid SVG circle attributes

Development

Clone the repository and install dependencies:

git clone https://github.com/jackall3n/react-dotted-map.git
cd react-dotted-map
bun install

Available Scripts

CommandDescription
bun devStart development mode with watch
bun playRun the playground for testing
bun testRun unit tests
bun run buildBuild the library for production
bun run typecheckRun TypeScript type checking

License

MIT License - see LICENSE for details.

FAQs

Package last updated on 01 Dec 2025

Did you know?

Socket

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.

Install

Related posts