Skip to content

NewMCP server for your coding agent. Set it up ›

Nexus UI
Get Pro

Interactive Globe Explorer, animated React component

An office finder: a dotted globe drawn on canvas beside a list of cities, with the address and email of the selected one ready to copy. Pick a city or its pin and the globe swings round on a spring, overshoots a touch and settles with the city in the middle, where its pin drops in with a bounce and sends out a ripple.

  • Pro
  • 3D Components
  • Spring
  • 3D

Play with it

Move the controls and watch it change. Copy code gives you a snippet with only the props you changed.

Drag to spin. Tap a pin.

Our offices

20

London

2 Bedford Gardens, London W8 7EH, UK

Props

PropTypeDefaultWhat it does
locations20 citiesPlaces to pin: { id, name, lat, lng, address, email }.
initialLocationId"4" (London)Id of the location selected first.
onSelect—Called whenever a location is selected.
title"Our offices"Heading above the list.
autoplayfalseFlies from city to city every few seconds until someone touches the explorer.
className—Classes for the card. Give it a height for the side-by-side layout; below 500px wide it stacks.

Add it to your project

  1. 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 creates components.json and the cn() helper in src/lib/utils.ts:

    npx shadcn@latest init -d

    Starting from nothing? The Quick Start walks through the whole thing.

  2. 2

    Connect the registry with your API key

    Interactive Globe Explorer is a Pro item, so the CLI has to send your API key. Do this once per project:

    1. Create a key at nexus-ui.com/dashboard/api-key. Copy it straight away: it starts with nxs_ and is shown only once.
    2. In your project root, next to package.json, create a file named .env.local with this line, using your own key:
      NEXUS_API_KEY=nxs_your_key_here
    3. Open components.json and 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}"
          }
        }
      }

How Interactive Globe Explorer works

An office finder: a dotted globe drawn on canvas beside a list of cities. Pick a city (or its pin) and the globe swings round on a spring, overshoots a touch and settles with the city in the middle, where its pin drops in

The source, the install command and the build prompt come with Pro.

About Interactive Globe Explorer

The Interactive Globe Explorer is the most feature-complete globe variant, with hover-state country highlighting, data label overlays, scroll-driven entrance animation, and full OrbitControls. Countries highlight on cursor hover with a color fill transition and display a data label. The scroll-driven entrance rotates and scales the globe into view from below the fold. Best for data products, analytics platforms, and any product where geographic scope is a selling point.

Good for

  • Data visualization and analytics sections
  • Geographic product reach showcases
  • Global infrastructure displays
  • Interactive product demo sections

Interactive Globe Explorer questions

How do I install the globe explorer?

Run `npx shadcn@latest add @nexus-labs/interactive-globe-explorer`. It installs react-globe.gl, three and lucide-react along with the shadcn/ui button.

How do I show my own office locations?

Pass a `locations` array of `{ id, name, lat, lng, address, email }` objects; without it the component shows 20 sample offices. `initialLocationId` picks the city the globe focuses on first.

Does it work with the Next.js App Router?

Yes. It is a client component and loads react-globe.gl through `next/dynamic` with `ssr: false`, so the WebGL globe only renders in the browser. Because it imports `next/dynamic`, it is built for Next.js projects.

Where does the earth texture come from?

The `globeTextureUrl` prop sets it, defaulting to `/images/earth-blue-marble.jpg`. Put an earth texture at that path in your public folder or point the prop at your own image.