Skip to content
StackD
Dotted globe, the StackD component

Widgets · Free

Dotted globe

Where your users are, on a world of dots: the land rises into 3D hills where they gather; drag, pinch to zoom, click a city to turn to it. Map built in.

Free on Gumroad: the download arrives in your inbox.

Details

Category
Widgets
Plan
Free
Code
React + Tailwind, TypeScript · 440 lines
Files
DottedGlobe.tsx
Needs
React and Tailwind only
Agents
MCP server and shadcn registry

About

Where your users are, on a world made of dots. Where more people are, the land rises: the dots stack up off the surface into soft hills, from grey at the foot to black at the top, like a 3D heat map you can turn. The busiest cities pulse now and then, as if someone just arrived.

Drag to spin it (it carries on with your throw, then goes back to its own pace), pinch or ctrl + scroll to zoom, point at a city to see how many users are there, click it and the globe turns to it. Arcs between places are there too, if you want them.

The world map is built in (Natural Earth, public domain, at 1°), so there's nothing to load. One canvas, drawn only while it's on screen; spinning on its own it draws 30 frames a second. React + Tailwind, no other libraries.

Install

With the shadcn CLI:

npx shadcn@latest add https://www.stackd.codes/r/dotted-globe.json

Or let your agent add it through the StackD MCP server:

claude mcp add --transport http stackd https://www.stackd.codes/mcp

Prompt for your agent

Paste it into Claude Code, Cursor, Codex or VS Code once the MCP server is connected.

Add the StackD Dotted globe component to this project. Use the StackD MCP server: call get_component with { "name": "dotted-globe" }, write the files at the paths it gives and install any npm packages it lists. Then use it where it fits, following its README for the props, and keep its own styles.

Use

  1. Copy DottedGlobe.tsx into your project (for example components/).
  2. Use it:
import { DottedGlobe } from './components/DottedGlobe'

<DottedGlobe
  size={480}
  places={[
    { lat: 52.37, lon: 4.9, label: 'Amsterdam', users: 1204 },
    { lat: 40.71, lon: -74.0, label: 'New York', users: 2310 },
    { lat: 35.68, lon: 139.69, label: 'Tokyo', users: 1655 },
  ]}
/>

In Next.js the file already starts with 'use client'. In other React setups that line does nothing.

Options

PropDefaultWhat it does
size440Width and height in px
places40 demo cities{ lat, lon, label?, users? }: where your users are; users sets the hill and the label
arcsnone{ from: [lat, lon], to: [lat, lon] }: arcs with a light running along them (GLOBE_ARCS has a few)
hillstrueThe land rises where your users are. Off: flat dots that darken instead
accent#BE9344Colour of the city marks, pulses and arcs
theme'light''light' or 'dark'
density2Degrees between dots; smaller is denser
spin6Degrees a second it turns on its own; 0 keeps it still
tilt18How far it leans towards you, in degrees
start10The longitude facing you at the start
zoom11 fits the box; above 1 it fills it and the edges fade into the page
zoomabletruePinch (or ctrl + scroll) to zoom between 0.8 and 3
classNameExtra classes

Accessibility

The canvas has a label with its busiest cities. With reduced motion on it doesn't spin or pulse; you can still drag it.

Colours from StackD

White #FFFFFF · Ink #141310 · Wine #901919 · Olive #6C8544 · Ochre #BE9344 · Lilac #C9B8FF

Licence

You can use it in personal and commercial projects. Don't resell or share the component on its own. The map data is Natural Earth (public domain).