Globe
ProNewA 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
| Prop | Type | Default |
|---|---|---|
| dots | numberNumber of dots on the sphere. | 1400 |
| speed | numberRadians per second. | 0.25 |
| markers | Marker[]Highlighted locations with a pulsing ring. | [] |
| color | stringDot color. Defaults to the current text color. | — |
| markerColor | string | "var(--brand-2)" |
| label | stringAccessible description, since the globe is drawn on a canvas. | "Rotating globe" |
| className | string | — |
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.