Drag to spin it.
Installation
$ pnpm dlx shadcn@latest add @synccn/globeFirst 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.
PropTypeDescription
- size
numberDefault
320Width and height in pixels.
- dots
numberDefault
1400Number of dots on the sphere.
- markers
{ lat: number; lng: number }[]Default
[]Pulsing points. Keep the array stable between renders.
- speed
numberDefault
0.003Rotation per frame, in radians.
- className
stringExtra 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
- lib/utilscn (merges class names)
npm packages
- clsx for cn()
- tailwind-merge for cn()
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
More motion
MarqueeEndless scrolling row or column that pauses on hover.Number TickerCounts up to a number when it scrolls into view.TypewriterTypes and deletes a list of phrases.Shimmer TextA light sweep across text for loading moments.Word RotateCycles words with a vertical slide.Text ScrambleCharacters scramble and resolve left to right.