Skip to content
synccn

Globe

New

Dotted, draggable globe with pulsing markers.

Drag to spin it.

Installation

$ pnpm dlx shadcn@latest add @synccn/globe

First time in this project? Connect synccn with one command.

Usage

import { Globe } from "@/components/ui/globe";<Globe markers={[{ lat: 34, lng: -118 }]} />

API reference

Generated from the component's TypeScript types, so it always matches the code.

Globe

Dotted globe on a canvas: slowly rotates, can be dragged, and can show pulsing markers. markers: [{ lat, lng }]. No map data or libraries needed.

  • size
    number

    Default 320

    Width and height in pixels.

  • dots
    number

    Default 1400

    Number of dots on the sphere.

  • markers
    { lat: number; lng: number }[]

    Default []

    Pulsing points. Keep the array stable between renders.

  • speed
    number

    Default 0.003

    Rotation per frame, in radians.

  • className
    string

    Extra classes for the root element.

Dependencies

Read from the component's imports when the site builds. The CLI installs all of these for you.

Helpers

npm packages

Accessibility

From the source

Read from this component's code when the site builds, so it can't drift.

  • ARIA roles: img
  • ARIA attributes: aria-label
  • Respects the reduced motion setting