Ballmac UI home

Dotted Map

A world map built from dots, with pulsing markers, optional labels and animated routes between places, as one lightweight SVG with a text summary for screen readers.

Installation

$ pnpm dlx shadcn@latest add @ballmac/dotted-map

Usage

import { DottedMap } from "@/components/ballmac/dotted-map"

The full example is in the Code tab above.

Examples

Dense map with labels

  • eu-west-1
  • us-east-1
  • ap-northeast-1
  • sa-east-1
  • af-south-1
  • ap-south-1

API reference

PropTypeDefault
markers

Places to mark.

MapMarker[][]
arcs

Routes to draw between places, animated as if traffic is flowing.

MapArc[][]
dots

Number of dots across the whole width. More dots give a finer, denser map.

number150
latRange

Southernmost and northernmost latitude to show.

[number, number][-56, 73]
tone

Color of the land dots.

MapTone"foreground"
labels

Write each marker's label on the map.

booleanfalse
label

Accessible summary of the map.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Screen readersThe map is an image whose name lists every labelled place
Reduced motionRoutes are drawn solid and markers do not pulse

Use with AI

<DottedMap markers={[{ lat, lng, label, tone }]} arcs={[{ from:[lat,lng], to:[lat,lng] }]} dots latRange tone labels />. The land mask is built in; nothing is fetched. Higher dots gives finer coastlines. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Dotted Map (@ballmac/dotted-map) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Where-we-operate and customer-location sections
  • Network and traffic visualizations

Not for

  • Interactive geographic data or zooming (use a map library)
  • A 3D globe (globe)

Registry JSON: https://ui.ballmac.com/r/dotted-map.json

Credits

Based on cobe, adapted by Ballmac. Free to use in personal and commercial projects.