Skip to Content

Bead Ring

Orbit ring decoration: a hairline ring in one color with a lit bead riding its track. Only the ring turns, so rings nest and an orb can sit still in the center; rotation stops under reduced motion.

Installation

pnpm dlx shadcn@latest add @01orbital/bead-ring

Usage

import { BeadRing } from "@/components/motion/bead-ring"
import { Orbital } from "@/components/orbs/orbital-v4"

const TIDEPOOL = {
  ground: "oklch(0.24 0.05 215)",
  upper:
    "radial-gradient(ellipse 140% 110% at 50% 38%, oklch(0.86 0.10 175) 0%, oklch(0.62 0.12 190 / 0.7) 52%, transparent 100%)",
  lower:
    "radial-gradient(ellipse 130% 100% at 50% 82%, oklch(0.28 0.07 235) 0%, oklch(0.28 0.07 235 / 0.8) 56%, transparent 100%)",
  glow: "oklch(0.80 0.11 180)",
  form: "strong",
} as const

// The orb is the lamp: the ground brightens toward it and falls off outward.
const LIT_GROUND =
  "radial-gradient(circle at 50% 50%, oklch(0.42 0.09 200 / 0.55) 0%, oklch(0.30 0.06 215 / 0.35) 22%, oklch(0.22 0.03 230 / 0.12) 48%, transparent 70%)"

export default function BeadRingDemo({
  animated = false,
}: {
  animated?: boolean
}) {
  return (
    <div
      data-demo="bead-ring"
      className="dark relative grid w-full place-items-center overflow-hidden bg-background"
      style={{ backgroundImage: LIT_GROUND }}
    >
      <div className="relative size-[min(84vw,600px)]">
        <BeadRing
          size={600}
          beadSize={22}
          color="oklch(0.74 0.13 188)"
          duration={30}
          animated={animated}
          style={{ width: "100%", height: "100%" }}
        />
        <BeadRing
          size={440}
          beadSize={18}
          color="oklch(0.76 0.12 352)"
          direction="ccw"
          duration={20}
          animated={animated}
          style={{ width: "73%", height: "73%" }}
        />
        <BeadRing
          size={300}
          beadSize={14}
          color="oklch(0.86 0.11 92)"
          duration={14}
          animated={animated}
          style={{ width: "50%", height: "50%" }}
        >
          <Orbital palette={TIDEPOOL} size={150} grain={0.25} />
        </BeadRing>
      </div>
    </div>
  )
}

This example installs with everything it uses:

pnpm dlx shadcn@latest add @01orbital/bead-ring-demo

Examples

Nested rings around an orbbead-ring-nested-orb

Bead Ring example: three rings nested and turning at different speeds, the middle one counter-clockwise, with a small Orbital ball at the center.

pnpm dlx shadcn@latest add @01orbital/bead-ring-nested-orb

Still beside movingbead-ring-still-and-moving

Bead Ring example: an outer ring held still with `animated={false}` around an inner ring that turns.

pnpm dlx shadcn@latest add @01orbital/bead-ring-still-and-moving

A color per ringbead-ring-two-colors

Bead Ring example: a gold ring around an indigo one turning the other way, each set with `color`.

pnpm dlx shadcn@latest add @01orbital/bead-ring-two-colors

Slow and fastbead-ring-speeds

Bead Ring example: a slow outer ring and a fast inner one, set with `duration`.

pnpm dlx shadcn@latest add @01orbital/bead-ring-speeds

Bead sizesbead-ring-bead-sizes

Bead Ring example: three nested rings with a large, a medium and a small bead, set with `beadSize`.

pnpm dlx shadcn@latest add @01orbital/bead-ring-bead-sizes

One ringbead-ring-single

Bead Ring example: a single ring with nothing inside it.

pnpm dlx shadcn@latest add @01orbital/bead-ring-single

Midnight Wordmarkbead-ring-midnight-wordmark

Orbit animation example showing BeadRing: nested amber and lilac beads counter-orbit a midnight wordmark.

pnpm dlx shadcn@latest add @01orbital/bead-ring-midnight-wordmark

API reference

A hairline ring with a lit bead riding it, used as an orbit around an orb or other content. Only the track turns; children sit still in the middle, so rings can nest.

It centers itself absolutely in its nearest positioned ancestor. The track is hidden from assistive tech. It turns while the pointer is over the area it sits in, and stays still with reduced motion.

Prop

Type

It also accepts the HTML attributes of the element it renders.

Dependencies

npm: cn. The CLI installs it for you.

Last updated on