Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Globe

ProNew

A dotted, draggable globe with pulsing markers. Canvas 2D, no dependencies.

Installation

pnpm dlx shadcn@latest add @viewport/globe

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
dotsnumber

Number of dots on the sphere.

1400
speednumber

Radians per second.

0.25
markersMarker[]

Highlighted locations with a pulsing ring.

[]
colorstring

Dot color. Defaults to the current text color.

—
markerColorstring"var(--brand-2)"
labelstring

Accessible description, since the globe is drawn on a canvas.

"Rotating globe"
classNamestring—

Accessibility

  • Canvas has role=img and a label you provide.
  • Holds still under reduced motion and pauses off screen.
  • Drag works with mouse, touch and pen.