---
title: "Globe"
description: "A dotted 3D globe that you can drag, zoom, and send on a tour. It shows places, routes, live labels, and clusters, in seven looks."
url: https://gelatinui.com/components/globe
markdown_url: https://gelatinui.com/components/globe.md
access: free
install: "npx shadcn@latest add @gelatin-ui/globe"
registry_item: https://gelatinui.com/r/globe.json
version: "2026-11-17"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Globe

> A dotted 3D globe that you can drag, zoom, and send on a tour. It shows places, routes, live labels, and clusters, in seven looks.

Page: https://gelatinui.com/components/globe

## When to use it

Best for: A hero or a status page that shows places, routes, and regions on a globe that people can turn.

- Give each place a `GlobeMarker` with a `location` of `[latitude, longitude]` and a `value`, so a press or the tour can pick it.
- Put a `GlobeLabel` inside a marker for its name; the label moves to a free side and fades on the far side.
- Use `GlobeArc` with `animateIn` and `travel` for a route that draws in and carries a dot.
- Set `framing="horizon"` for the top of a hero, and `cluster` when many places sit close together.

## Notes for agents

- `variant` picks one of seven looks: `dot`, `night`, `neon`, `ghost`, `ink`, `aurora`, and `brand`. `brand` reads the `--globe-*` custom properties and `--primary`.
- `value` and `onValueChange` hold the place at the front; it is the `value` of a `GlobeMarker`. `null` is none.
- `tour` walks the places with a `value`, one every 4 seconds (or every `tour` ms). A hover or the focus holds it.
- `defaultCenter="visitor"` starts at the place of the visitor's time zone, with no location prompt.
- With no WebGL, a plain sphere shows, and the markers and labels still sit on their places.
- The frame loop runs only while the globe is on screen and the tab shows. `paused` holds every motion.

## Anatomy

```text
Globe
├─ GlobeMarker (0..n)
├─ GlobeLabel (0..n)
├─ GlobeArc (0..n)
├─ GlobeZoom (0..n)
├─ GlobeZoomIn (0..n)
├─ GlobeZoomOut (0..n)
├─ GlobePlaceList (0..n)
└─ GlobePlaceItem (0..n)
```

## API reference

### Globe

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  |  |
| `draggable` | `boolean` | true | A drag turns the globe and a pinch or a Ctrl/⌘ wheel zooms it. Default true. |
| `variant` | `"aurora" \| "brand" \| "dot" \| "ghost" \| "ink" \| "neon" \| "night"` | "dot" | The colors and shading. Default `dot` (theme colors). |
| `framing` | `GlobeFraming` | "full" | `full`: the whole globe. `horizon`: a large globe cut by the bottom edge. Default `full`. |
| `value` | `string \| null` |  | The place at the front (a `GlobeMarker` `value`), controlled. `null`: none. |
| `defaultValue` | `string \| null` | null |  |
| `onValueChange` | `function` |  |  |
| `defaultCenter` | `"visitor" \| GlobeLocation` | GLOBE_DEFAULT_CENTER | The front the globe shows first: `[latitude, longitude]`, or `"visitor"` (the time zone place). |
| `spin` | `boolean` | true | The globe turns on its own while nothing holds it. Default true. |
| `spinSpeed` | `number` | 6 | Degrees per second of the spin; below 0 turns the other way. Default 6 (a turn a minute). |
| `paused` | `boolean` | false | Holds every motion of the globe with no control on screen. Default false. |
| `freeSpin` | `boolean` | false | A flick keeps the globe spinning: it eases from the flick speed to the spin speed and never stops, even under the pointer. Default false (a release glides to a stop). |
| `zoom` | `number` |  | The zoom, 1 is the framing size. Controlled. |
| `defaultZoom` | `number` | 1 |  |
| `onZoomChange` | `function` |  |  |
| `minZoom` | `number` | 1 |  |
| `maxZoom` | `number` | 3 |  |
| `tour` | `number \| boolean` | false | Walk the places with a `value`, one each `tour` ms (`true`: 4000). Default false. |
| `scrollTurn` | `number` | 0 | Degrees the globe turns while it scrolls through the view. Default 0 (off). |
| `cluster` | `boolean` | false | Places too close to label fold into one bubble with a count. Default false. |
| `mapSamples` | `number` |  | Dots on the sphere (default 20,000; Ink doubles them). |
| `labels` | `Partial<GlobeLabels>` |  | The words: the root name, the zoom buttons, and the cluster bubbles. |

### GlobeMarker

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `location` | `GlobeLocation` |  | `[latitude, longitude]` in degrees. |
| `dotSize` | `number` | GLOBE_MARKER_SIZE | Cobe's dot size, 0 to 1 of the sphere. Default 0.04. |
| `color` | `string` |  | A CSS color for this dot (a token works: `var(--chart-3)`). Default: the look's marker color. |
| `value` | `string` |  | The place id: a tap, the place list, the tour, and the root `value` use it. |
| `name` | `string` |  | The place name a cluster bubble shows (`London +3`). |
| `pulse` | `boolean` | false | A ring goes out from the dot every 1.6s: new data, a live place. |
| `className` | `string` |  | The classes of the marker anchor (the pulse ring and the no-WebGL dot take its color). |
| `children` | `ReactNode` |  | Its labels. |

### GlobeLabel

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `side` | `GlobeLabelSide` | "top" | The side of its place it asks for; it moves to a free side when another label is there. |
| `offset` | `number` | 10 | px between the place and the label. Default 10. |
| `variant` | `"pill" \| "plain"` | "pill" | `pill` (default): a small surface; `plain`: no look, for a card or an avatar of your own. |

### GlobeArc

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` |  |  |
| `from` | `GlobeLocation` |  |  |
| `to` | `GlobeLocation` |  |  |
| `color` | `string` |  | A CSS color for this arc. Default: the look's arc color. |
| `animateIn` | `boolean` | false | The arc draws from its start with a bright head on entry (the `draw` clock, 0.9s). |
| `travel` | `boolean` | false | A dot rides the arc on a loop (2.4s a pass) and hides behind the rim. |

### GlobeZoom

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `orientation` | `"horizontal" \| "vertical"` |  |  |
| `className` | `string` |  |  |

### GlobeZoomIn

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### GlobeZoomOut

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `glass` | `"clear" \| "dark" \| "light"` |  |  |
| `rounded` | `"default" \| "full"` |  |  |
| `size` | `"default" \| "icon" \| "icon-lg" \| "icon-sm" \| "icon-xs" \| "lg" \| "sm" \| "xl" \| "xs"` |  |  |
| `variant` | `"dashed" \| "default" \| "destructive" \| "destructive-outline" \| "ghost" \| "link" \| "media" \| "outline" \| "secondary"` |  |  |
| `className` | `string` |  |  |
| `busy` | `boolean` |  | The button waits for the app (busy words): a spinner, `aria-busy`, and no clicks. Focus stays on the button. The style hook stays `data-loading`. |
| `spinnerPlacement` | `"center" \| "start"` |  | `center` (default): the spinner covers the label. `start`: it takes the leading icon slot. The icon sizes always use `center`, because their one icon is the label. |

Also takes every prop of Base UI `Button`: https://base-ui.com/react/components/button

### GlobePlaceList

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` |  | Height 24, 28, 32, or 36px. |
| `className` | `string` |  |  |
| `variant` | `"default" \| "outline"` |  | The look of the items: `outline` (default) for a row of toggles, `default` for quiet rows with no border (a list of places or views in a panel, pressed on the accent fill). |
| `spacing` | `0.5 \| 1 \| 2 \| 3 \| 4` |  | The gap between the items: 0.5 to 4 is 2 to 16px. Default 2 (8px). |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `ToggleGroup`: https://base-ui.com/react/components/toggle-group

### GlobePlaceItem

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `className` | `string` |  |  |
| `size` | `"default" \| "lg" \| "sm" \| "xs"` |  | Height 24, 28, 32, or 36px. |
| `rounded` | `"default" \| "full"` |  |  |

Also takes every prop of Base UI `Toggle`: https://base-ui.com/react/components/toggle

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| Globe | `globe` | `data-draggable`, `data-dragging`, `data-over-marker` |  |  |
| GlobeMarker | `globe-marker` | `data-fallback` |  | `motion-timing` |
| GlobeLabel | `globe-label` | `data-focused`, `data-hidden`, `data-placed` |  | `motion-timing` |
| GlobeArc | `globe-arc` | `data-hidden` |  |  |
| GlobeZoom | `globe-zoom` |  |  |  |
| GlobeZoomIn | `globe-zoom-in` |  |  |  |
| GlobeZoomOut | `globe-zoom-out` |  |  |  |
| GlobePlaceList | `globe-place-list` |  |  |  |
| GlobePlaceItem | `globe-place-item` | `data-far` |  |  |

## Usage

Give each place a marker with its location and a label. Arcs and the zoom buttons are parts too.

```tsx title="edge-regions-globe.tsx"
import { Globe, GlobeArc, GlobeLabel, GlobeMarker, GlobeZoom } from "@/components/effects/globe";

const REGIONS = [
  { id: "fra", name: "Frankfurt", location: [50.11, 8.68], ms: 42 },
  { id: "iad", name: "Virginia", location: [39, -77.5], ms: 96 },
  { id: "sin", name: "Singapore", location: [1.35, 103.82], ms: 71 },
  { id: "nrt", name: "Tokyo", location: [35.69, 139.69], ms: 224 },
] as const;

export function EdgeRegionsGlobe() {
  return (
    <Globe variant="night" defaultCenter={[30, 20]} className="w-md max-w-full">
      {REGIONS.map((region) => (
        <GlobeMarker
          key={region.id}
          value={region.id}
          name={region.name}
          location={region.location}
        >
          <GlobeLabel>
            {region.name}
            <span className="text-muted-foreground tabular-nums">{region.ms} ms</span>
          </GlobeLabel>
        </GlobeMarker>
      ))}
      <GlobeArc from={[50.11, 8.68]} to={[1.35, 103.82]} animateIn travel />
      <GlobeZoom className="end-3 bottom-3" />
    </Globe>
  );
}
```

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/globe
```

It adds 78 registry items: 75 files, 12614 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `@phosphor-icons/react`, `@xstate/react`, `clsx`, `cobe`, `motion`, `tailwind-merge`, `tailwind-variants`, `xstate`.

## Built on

- [Button](https://gelatinui.com/components/button.md)
- [Button Group](https://gelatinui.com/components/button-group.md)
- [Toggle Group](https://gelatinui.com/components/toggle-group.md)

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp

## Related

- [Time Zone Select](https://gelatinui.com/components/time-zone-select.md)
- [Clock](https://gelatinui.com/components/clock.md)
- [Border Beam](https://gelatinui.com/components/border-beam.md)

## Keyboard

| Keys | Action |
| --- | --- |
| ← → | Turns the globe 15° west or east. |
| ↑ ↓ | Leans the globe 15° north or south, up to 60°. |
| +, - | Zooms in or out one step. |
| Page Down, Page Up | Turns the next or the previous place to the front. |
| Home | Clears the pick and turns the globe back to its start. |
| Escape | Clears the pick. A second Escape goes to the page. |

## Motion

| Part | Motion |
| --- | --- |
| Release | glide · a drag release glides on inertia and settles in about 1.5s |
| Free spin | glide · with `freeSpin`, a flick keeps its speed and eases to the spin speed over about 1.6s, and never stops |
| Turn to a place | chart · a spring turns the picked place to the front and zooms |
| Spin | progress · 6° a second by default (`spinSpeed`), at one speed |
| Pulse | flow · a ring goes out from the dot every 1.6s |
| Arc draw-in | draw · 900ms · ease-panel · the route draws from its start with a bright head |
| Labels | popup · 150ms · fade in on the near side, out on the far side |
