Skip to content
WANCRAFT

H.603D & Experimental

Wireframe Globe

A rotating canvas globe with a depth-faded graticule, pulsing markers and travelling great-circle arcs.

NewReactCanvasadvanced

Overview

Wireframe Globe draws a latitude/longitude graticule on canvas 2D with orthographic projection, fading lines by depth so the far hemisphere sits quietly behind the near one. Markers pulse on the visible side with optional mono labels, and arcs between marker pairs follow true great circles, lifted above the surface in proportion to their length, with a bright segment travelling along each route. Drag with mouse, pen or touch to spin it — pointer capture keeps the drag alive outside the element and a release flings it with inertia — or focus it and use the arrow keys. No map data, no WebGL, no dependencies.

01Installation

Method 01 · Registry

CLI verified

Uses the shadcn CLI in a project initialised with shadcn init. Installs the file to components/ui/wireframe-globe.tsx and adds its dependencies.

npx shadcn@latest add https://wancraft.my/r/wireframe-globe.json

Method 02 · Copy and paste

  1. 1. No extra dependencies — React and Tailwind CSS only.
  2. 2. Copy the source from the Code tab into components/ui/wireframe-globe.tsx.
  3. 3. Import it and adjust props.
Dependencies
None
Peer
react ≥ 18, tailwindcss ≥ 4
Added
13 Oct 2026
Updated
—

02Usage

The default configuration. Change properties above to generate a tailored example in the Usage tab.

example.tsx
import { WireframeGlobe, type GlobeMarker, type GlobeArc } from "@/components/ui/wireframe-globe";

export function WireframeGlobeExample() {
  const markers: GlobeMarker[] = [
    { id: "kul", lat: 3.139, lon: 101.687, label: "Kuala Lumpur" },
    { id: "lhr", lat: 51.507, lon: -0.128, label: "London" },
    { id: "nyc", lat: 40.713, lon: -74.006, label: "New York" },
    { id: "tyo", lat: 35.676, lon: 139.65, label: "Tokyo" },
    { id: "syd", lat: -33.869, lon: 151.209, label: "Sydney" },
  ];
  const arcs: GlobeArc[] = [
    { from: "kul", to: "lhr" },
    { from: "kul", to: "tyo" },
    { from: "kul", to: "syd" },
    { from: "lhr", to: "nyc" },
  ];

  return (
    <div className="relative h-[440px] w-full">
      <WireframeGlobe markers={markers} arcs={arcs} />
    </div>
  );
}

03Props

PropTypeDefaultDescription
markersGlobeMarker[][]{ lat, lon, label?, id? } points that pulse on the surface. Hoist or memoize the array.
arcsGlobeArc[][]{ from, to } great-circle arcs; each end is a marker index, id or label.
autoRotatebooleantrueSpin continuously around the polar axis.
speednumber1Auto-rotation speed multiplier (1 ≈ 9°/s).
gridStepnumber15Graticule spacing in degrees (5–90).
tiltnumber18Initial tilt toward the viewer in degrees; positive shows more of the north.
colorstring"#FF7448"Marker colour (any CSS colour).
arcColorstring"#B6F3D1"Arc colour (any CSS colour).
showLabelsbooleantrueShow marker labels on the visible hemisphere.
draggablebooleantrueDrag and arrow keys rotate the globe; also makes it focusable.
radiusnumber0.4Globe radius as a fraction of the smaller container side.
labelstring—Accessible name; defaults to a summary of the markers and arcs.
...propsHTMLAttributes<HTMLDivElement>—Forwarded to the root, which fills its parent.

04Features

  • 01Orthographic projection with back / limb / front depth bands
  • 02True great-circle arcs (slerp), lifted by length, with a travelling highlight
  • 03Pulsing markers with mono labels that fade toward the limb
  • 04Drag with pointer capture and inertial fling; arrow keys when focused
  • 05Rotation survives prop changes; theme-aware ink
  • 06DPR-aware canvas (capped at 2), ResizeObserver, pauses offscreen and in hidden tabs
motion · continuousinput · draginput · keyboardinput · focusinput · viewport

05Accessibility

  • The root is role="img" with an aria-label summarising the markers and connections (override with label).
  • When draggable it is focusable; arrow keys rotate it and a dashed ring around the globe marks keyboard focus.
  • Touch drags rotate horizontally only (touch-action: pan-y), so vertical swipes still scroll the page.
  • prefers-reduced-motion stops auto-rotation, pulses, arc travel and inertia; drag and keys rotate in direct steps.

06Limitations

  • No coastlines or country shapes — it is a stylised wireframe, not a map.