Dot Globe, animated React component
- Pro
- 3D Components
- 3D
- Spring
A dotted globe with flight arcs drawing themselves along great circles. Drag to spin it and it coasts to a stop; pick a city and it springs round to face you.
Props
| Prop | Type | Default | What it does |
|---|---|---|---|
| size | number | 340 | Width and height of the globe canvas in px. |
| accent | string | "#0071e3" | Colour of the arcs, pins and the selected city chip. |
| cities | DotGlobeCity[] | DOT_GLOBE_CITIES | Cities to pin and list as chips. Each has id, name, lat and lon. |
| routes | [string, string][] | DOT_GLOBE_ROUTES | Flight arcs as pairs of city ids; pairs with an unknown id are skipped. |
| autoplay | boolean | false | Turns slowly and tours the cities until someone drags or picks one. |
Add it to your project
- 1
Set up your project once
You need a Next.js project with Tailwind CSS and the
@/import alias. In its root folder, run this once. It createscomponents.jsonand thecn()helper insrc/lib/utils.ts:npx shadcn@latest init -d
Starting from nothing? The Quick Start walks through the whole thing.
- 2
Connect the registry with your API key
Dot Globe is a Pro item, so the CLI has to send your API key. Do this once per project:
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
nxs_and is shown only once. - In your project root, next to
package.json, create a file named.env.localwith this line, using your own key:NEXUS_API_KEY=nxs_your_key_here
- Open
components.jsonand add this entry inside the outermost braces, next to"aliases". Leave{name}and${NEXUS_API_KEY}exactly as written; the CLI fills them in:"registries": { "@nexus-labs": { "url": "https://www.nexus-ui.com/api/registry/{name}", "headers": { "Authorization": "Bearer ${NEXUS_API_KEY}" } } }
- Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with
How Dot Globe works
True when the point (degrees) is on land, as far as the outline can tell.
The source, the install command and the build prompt come with Pro.
Dot Globe questions
How do I install the Dot Globe?
Run `npx shadcn@latest add @nexus-labs/dot-globe`. It installs framer-motion only; the globe is drawn on a 2D canvas with its own projection math, so it does not use three.js or WebGL. It is a Pro component, so it needs a Pro plan and an API key; key setup is on the CLI docs page (/docs/cli).
How do I add my own cities and flight routes?
Pass `cities` as `{ id, name, lat, lon }` objects and `routes` as pairs of city ids, for example `[["ber", "nyc"]]`. A route that names an unknown id is skipped. The defaults are the exported `DOT_GLOBE_CITIES` and `DOT_GLOBE_ROUTES`.
Does it draw continents or a real map?
No. The 1,600 dots sit on an even lattice over the whole sphere, so the globe has no land shapes. Only your city pins and the great-circle arcs between them carry geographic meaning, which suits a flight or office-network visual rather than a map.
How do I control the size and color, and how does interaction work?
`size` is the square canvas size in px (default 340) and `accent` colors the arcs, pins and selected chip (default `#0071e3`). Dragging spins the globe and it coasts to a stop, and clicking a city chip springs the globe round to it. The chips are buttons with `aria-pressed`, so they give keyboard users a way to rotate it, and the canvas has `role="img"` with a label naming the selected city.

