08

Dot Globe

A rotating sphere of a thousand dots projected onto Canvas 2D. Adjust its color and rotation speed through props. No rendering dependencies required.

Canvas 2Dperspectivepoint sphere
Live

Installation

Add it to your project

$
pnpm dlx shadcn@latest add https://funshader.com/r/dot-globe.json

Installs 1 files into components/shaders. Uses the native Canvas 2D API; no extra dependencies.

Usage

Mount it behind your content

app/hero.tsx
import { DotGlobe } from "@/components/shaders/dot-globe/dot-globe";

export function Hero() {
  return (
    <section className="relative isolate min-h-svh overflow-hidden">
      <DotGlobe className="-z-10" color="#ffffff" />
      {/* your content */}
    </section>
  );
}

The shader fills its nearest positioned ancestor. Give the parent relative isolate and the shader -z-10 to put it behind everything else.

API reference

Props

PropTypeDefaultDescription
pausedbooleanfalsePauses animation. Reduced motion is respected automatically.
classNamestring—Canvas classes.
styleCSSProperties—Inline canvas styles.
colorstring"#000000"Dot fill color.
speednumber1Rotation speed multiplier.

Keep exploring

More shaders