Skip to content
VenusUI
Get started

Arc Globe

A dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.

Preview

Installation

npx shadcn@latest add @venusui/arc-globe

Run this in a project set up with shadcn. If you haven’t set it up yet, run npx shadcn@latest init first.

Files added to your project

Paths use the default shadcn aliases. The CLI follows the aliases in your components.json.

  • @/hooks/use-scene-state.tsfrom use-scene-state
  • @/components/ui/arc-globe.tsx
  • @/lib/land-mask.ts

Usage

The code behind the preview above.

arc-globe-demo.tsx

import { ArcGlobe } from "@/components/ui/arc-globe"

export default function ArcGlobeDemo() {
  return <ArcGlobe className="max-w-md" />
}

API reference

PropTypeDefaultDescription
routes{ from: [lat, lon]; to: [lat, lon] }[]12 links between major citiesArcs to draw, as latitude/longitude pairs in degrees.
startLongitudenumber20Longitude turned toward the viewer at the start.
speednumber0.07Auto-rotation speed, in radians per second.
pulseSpeednumber1How fast pulses travel along the arcs.
dotsnumber16000Points sampled over the sphere; about a third fall on land and are drawn.
dotSizenumber2.4Dot size in pixels.
arcColors[string, string]["#a78bfa", "#22d3ee"]Start and end color of each arc; the end color is also used for landing rings.
atmosphereColorstring"#6d5dfc"Color of the glow around the rim.
labelstring"Globe with routes between cities"Accessible description of the graphic.
classNamestring—Classes for the wrapper; set the dot color with a text class.

Only the props above.

Requirements

  • three and @react-three/fiber (React 19). The CLI installs both, plus @types/three as a dev dependency.
  • The CLI also adds lib/land-mask.ts, an 11 KB map of the continents (Natural Earth 1:110m, public domain).
  • A browser with WebGL. Without it, a short text fallback is shown.

Customization

  • Pass your own routes, for example your offices or data centers: [{ from: [51.5, -0.13], to: [40.71, -74] }].
  • Dots use the CSS text color, so className="text-primary" tints the continents and follows theme changes.
  • Colors in arcColors and atmosphereColor go to three.js, which reads hex, rgb() and hsl() but not oklch().
  • It looks best on dark backgrounds, but works on light ones too: the far side is hidden without painting a color.

Accessibility

  • Exposed as an image with a label. It can be focused and turned with the arrow keys.
  • On touch screens, vertical swipes still scroll the page; horizontal swipes turn the globe.
  • Rendering pauses when off screen. With reduced motion it doesn’t rotate or pulse on its own, but you can still turn it.

Troubleshooting

The continents are invisible.
Their color comes from the text color. Make sure the wrapper isn’t text-transparent and contrasts with the background.
An arc color is black.
three.js couldn’t parse it. Use a hex, rgb() or hsl() color.
Cannot find module 'three' types.
Run npm install -D @types/three.
Unknown registry "@venusui"
Your shadcn CLI couldn’t find the namespace in the shadcn registry index. Use the latest CLI (npx shadcn@latest), install by URL, or register it with its address: npx shadcn@latest registry add @venusui=https://venusui.com/r/{name}.json.
No components.json found
Run npx shadcn@latest init in your project first.
Loading preview

A WebGL sphere of evenly spaced dots that slowly turns; drag or use the arrow keys to spin it.

Loading preview

Cards arranged in a ring that turns in 3D, with buttons, arrow keys and announcements.

Loading preview

A card that tilts toward the pointer while its layers rise off the surface, each to its own depth.