npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@globestudio/react

v0.2.0

Published

React component that embeds a Globestudio dotted globe. Works in React, Next.js, Remix, Astro and anywhere JSX renders.

Readme

@globestudio/react

React component that embeds Globestudio dotted globes and maps. It has no dependencies, works with SSR and autocompletes preset names.

Install

npm install @globestudio/react
# or pnpm add @globestudio/react
# or yarn add @globestudio/react

For a new project, copy the starter instead. It is a Vite app with a globe on the page:

npx degit alevizio/globestudio/examples/starter-react my-globe

Or open it in StackBlitz to try it with nothing to install.

Use

import { Globe } from "@globestudio/react";

export default function Page() {
  return (
    <section>
      <h1>Worldwide coverage</h1>
      <Globe look="aurora" width={800} height={600} />
    </section>
  );
}

The component is a styled <iframe> over globestudio.app/embed, so the heavy work (Three.js, shaders, country data) runs on the embed origin and your bundle stays a couple hundred bytes.

In the app, the export dialog's Share tab writes a <Globe config=… /> snippet for the design on screen: pick React under Embed code and copy it.

On a light page, add theme="light", so Wireframe's white ink turns graphite instead of all but vanishing:

<Globe look="wireframe" theme="light" />

Halftone, Toon and Threshold paint a dark page of their own, where graphite ink is lost, so make them see-through in the config as well:

<Globe look="halftone" theme="light" config='{"backgroundStyle":"transparent"}' />

Props

| Prop | Type | Default | Notes | |---|---|---|---| | look | LookId | "halftone" | Autocomplete on every shipped preset | | width | number \| string | "100%" | A number means pixels | | height | number \| string | 480 | A number means pixels | | config | string | | The design's JSON string (JSON.stringify(design)), not URL encoded. Layered over look when you pass both, or over Default alone. A whole share link, or its ?c= query, works too | | theme | "light" \| "dark" | "dark" | "light" suits a light page: the glow and grid switch to a palette for light pages, and the white ink of Halftone, Wireframe, Toon and Threshold turns graphite. Halftone, Toon and Threshold paint a dark page of their own, so make them see-through in config too | | title | string | "Globestudio dotted globe" | A11y label | | className | string | | Forwarded | | style | CSSProperties | | Merged after border: 0 | | loading | "lazy" \| "eager" | "lazy" | Off-screen embeds defer WebGL until scrolled near | | source | string | | Tag for analytics attribution | | onLoad | (e) => void | | Forwarded |

Helpers

import { globestudio } from "@globestudio/react";

const embed = globestudio.embedUrl({ look: "vapor" });
//          → "https://globestudio.app/embed?look=vapor"

const thumb = globestudio.thumbnailUrl("halftone");
//          → "https://globestudio.app/looks/halftone.png"

// A share config is URL-encoded JSON: the ?c= value from a link the
// Share dialog made, or one you build yourself. "v": 3 tells Globestudio
// it was encoded once, so every value (a "%" too) arrives as written, and
// that its colors render as their hex.
const payload = encodeURIComponent(JSON.stringify({ v: 3, selection: "country:JPN" }));
const share = globestudio.shareUrl(payload);
//          → "https://globestudio.app/?c=%7B%22v%22%3A3%2C%22selection%22%3A%22country%3AJPN%22%7D"

Use these when you need the URL but not the iframe (e.g. Next.js <Image src>, server-rendered markup, OG metadata).

SSR

The component is plain JSX. It renders the iframe HTML on the server and hydrates on the client without re-mounting, since it has no client-only state and no useEffect.

// app/page.tsx (Next.js App Router)
import { Globe } from "@globestudio/react";

export default function Page() {
  return <Globe look="risograph" />;
}

Sizing patterns

// Fill container
<Globe look="halftone" />  {/* width="100%", height=480 default */}

// Square in a card
<div style={{ width: 320, aspectRatio: "1 / 1" }}>
  <Globe look="aurora" width="100%" height="100%" />
</div>

// Background hero
<section style={{ position: "relative", height: 520 }}>
  <Globe
    look="vapor"
    width="100%"
    height="100%"
    style={{ position: "absolute", inset: 0 }}
  />
  <div style={{ position: "relative", padding: 64 }}>
    <h1>Hero content over the globe</h1>
  </div>
</section>

Package or snippet

Most people start with the snippet on globestudio.app/integrations. The package adds:

  • TypeScript autocomplete on look, so typos get caught
  • Versioning: pin a tested version and upgrade when you choose
  • A one-line install in SaaS templates that ship via npm
  • globestudio.* helpers for building URLs outside the iframe

The whole API is one component and one helper object.

License

MIT. See LICENSE.