Skip to content
VenusUI
Get started

Dotted Globe

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

Preview

Installation

npx shadcn@latest add @venusui/dotted-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/dotted-globe.tsx

Usage

The code behind the preview above.

dotted-globe-demo.tsx

import { DottedGlobe } from "@/components/ui/dotted-globe"

export default function DottedGlobeDemo() {
  return <DottedGlobe className="max-w-xs" />
}

API reference

PropTypeDefaultDescription
dotsnumber1600Number of dots on the sphere.
dotSizenumber2Dot size in pixels.
speednumber0.15Auto-rotation speed, in radians per second.
labelstring"Rotating globe made of dots"Accessible description of the graphic.
classNamestring—Classes for the wrapper; set the 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.
  • A browser with WebGL. Without it, a short text fallback is shown.

Customization

  • Dots use the CSS text color: className="text-primary" tints the globe, and it updates when the theme changes.
  • Fewer dots look sparser and render faster on low-end phones.

Accessibility

  • Exposed as an image with a label. It can be focused and turned with the arrow keys.
  • Rendering pauses when off screen. With reduced motion it doesn’t auto-rotate, but you can still turn it.

Troubleshooting

The globe is invisible.
Its color comes from the text color. Make sure the wrapper isn’t text-transparent and the background contrasts.
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 dotted 3D Earth with glowing routes between cities; pulses travel each arc and ripple where they land.

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.