Dotted sphere preview

Dotted sphere

A ball of evenly spread dots, lit by depth, that turns slowly while its surface breathes in waves, or spins and can be flung. The pointer presses a soft dent into the front face. 2D canvas, no WebGL, follows the theme.

  • Group
    Effects
  • Origin
    Inspired · Original (this library)
  • License
    MIT
  • Added
    Oct 23
npx shadcn@latest add @deank/dotted-sphere

The registry stays private. Install from the repo with a GitHub token — see the README.

Usage

import { DottedSphere } from "@/registry/components/dotted-sphere/dotted-sphere";

<DottedSphere />

Props

PropTypeDefaultDescription
size?number320Width and height in px.
dots?number1000How many dots. 600 to 1,500 reads well between 240 and 480 px.
dotSize?number1.6Radius of a dot on the front face, in px. Dots at the back are about half that.
color?string"currentColor"Dot colour. Any CSS colour or token, such as "var(--accent)". Follows theme switches.
mode?DottedSphereMode"float"float: slow turn while the surface breathes in waves. rotate: a steady spin you can drag and fling.
speed?number1Speed multiplier for the turn and the waves. 0 holds still.
tilt?number16Tilt of the spin axis towards the viewer, in degrees.
wave?number0.07How far the float waves lift the surface, as a share of the radius (0 to 0.2).
interactive?booleantrueLet the pointer dent the front face (and drag in rotate mode).
paused?booleanfalseDraw one still frame and stop.
label?stringAccessible name. With it the sphere is role="img"; without it, it is decorative and hidden.

Also accepts every prop of Omit<HTMLAttributes<HTMLDivElement>, "color">.

When to use

A calm, technical centrepiece for a hero, a launch or waitlist page, an empty state or an "about the network" section, where a globe-like object says global, connected or data without drawing a real map.

When not to use

Real geography or locations (use a map); many on one screen; behind body text without a contrast layer; a status indicator for an agent (liquid-orb, robot-head).

Related

Liquid orb · Ripple · Aurora background · Magnet lines