Globe / World Map

The world in dots, as a turning globe or a flat map, with places marked and arcs between them.

PROGet Globe / World Map and 168 other Pro components with pro lifetime — Get Pro

Category
Marketing
Access
Pro
Source
364 lines · one file
States
5 drawn

The decision inside it

No map library

A 2° dot grid in a few kilobytes draws instantly and offline, and it is all you need for a marketing map of where things happen.

When to use it

Use Globe / World Map on a marketing page to show where things happen: offices, customers, signatures. For real geography (zoom, streets) use a map library.

Installation

How you get it

Paste this into Claude Code, Cursor, Codex or any coding agent. It installs the file and uses it as it is, instead of writing a new one.

Use Liro's Globe / World Map for this.
Install it: npx shadcn@latest add @liro/globe-map
(the @liro registry is set up in components.json, with LIRO_KEY in .env.local)
Import it from @/components/ui/globe-map.
Do not rewrite or restyle it. Pass my data through its props
and keep its built-in states.

For the full brief with every prop and the mistakes assistants usually make, use Copy prompt above. Pro components install through the @liro registry with your CLI token: see the Namespaced tab.

Usage

components/global-reach.tsx
import { GlobeMap } from "@/components/ui/globe-map";

export function GlobalReach() {
  return (
    <GlobeMap
      points={[{ lat: 51.5, lng: -0.1, label: "London" }, { lat: 40.7, lng: -74, label: "New York" }]}
      arcs={[{ from: [51.5, -0.1], to: [40.7, -74] }]}
    />
  );
}

API reference

“Copy prompt” above puts a full brief on your clipboard, install command, dependencies, props, and the mistakes an assistant usually makes with this component.

Props

Read from the component’s own TypeScript interface when the site is built, so this table cannot drift from the file you install.

TypeNotes
variant"globe" | "flat" NoA turning globe or a flat map. Default "globe".
pointsGlobePoint[] No–
arcsGlobeArc[] No–
highlightContinent[] NoContinents to tint: "NA", "SA", "EU", "AF", "AS", "OC".
autoRotateboolean NoTurn slowly on its own (globe). Default true.
interactiveboolean NoDrag and arrow keys turn it (globe). Default true.
initialLngnumber NoThe longitude facing you at the start. Default 10.
labelstring NoWhat the map shows, for screen readers. Default built from the point labels.
showLabelsboolean NoTags with each point's label beside it (globe and flat). Default true.

Dependencies

npm packages

clsxtailwind-merge

Liro foundations, installed alongside it

liro-theme

States

All of them are drawn by the component. None is left for you to design.

  • Globe
  • Flat
  • Highlighted continent
  • Dragging
  • Reduced motion

Accessibility

  • Keyboard reachable throughout, in visual order
  • Focus trapped in overlays, Escape closes them
  • Focus returns to whatever opened it
  • Live regions announce what changed, not that something did
  • Honours prefers-reduced-motion

Responsive behavior

  • Sizes to its container, not the viewport
  • Usable from 320px up
  • Pointer-based interaction, so trackpad and touch both work
  • No hover-only affordances