# Iridescent Orb

> A glossy pearl of slowly swirling colour that breathes, catches the light and leans towards the cursor. A calm centrepiece for a hero.

Category: Backgrounds · Free · Updated 2026-11-09 · Live demo: https://www.motionkitui.com/components/iridescent-orb

## When to use it

AI product and assistant heroes, wellness and audio apps, waitlist and launch pages, and anywhere a single calm, premium focal point beats a busy illustration.

## How it works

Inside a round clip, two oversized conic gradients built from your four colours turn in opposite directions, heavily blurred, with the top one in soft-light blend mode, so where they overlap the colour swirls and never repeats exactly. A pale band drifts across in overlay mode for the pearl sheen. Radial shading darkens the underside and a moving highlight sits up and to the left, which is what makes it read as a sphere. A blurred copy of the gradient glows behind it, and the whole orb breathes and leans towards the cursor on springs.

## Installation

```bash
npx shadcn@latest add https://www.motionkitui.com/r/iridescent-orb.json
```

Or copy `components/motionkit/iridescent-orb.tsx` below. Requires react, motion and Tailwind CSS v4. Free for personal projects; commercial use needs MotionKit Plus (https://www.motionkitui.com/pricing).

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `colors` | `[string, string, string, string]` | `["#5FAEB4", "#B79AD3", "#F2B8A2", "#8FBFB3"]` | The four colours that swirl through the pearl. |
| `size` | `number` | `220` | Diameter in pixels. |
| `speed` | `number` | `14` | Seconds for one full swirl. Larger is calmer. |
| `interactive` | `boolean` | `true` | Lean towards the cursor and roll the highlight with it. |
| `children` | `ReactNode` |  | Content floating in front, such as a logo. |

## Accessibility

- **Keyboard: Not applicable.** Decorative, nothing to focus.
- **Screen readers: Pass.** The orb is hidden from assistive tech; anything you place in front of it is read as normal.
- **Reduced motion: Partial.** With reduced motion on, the swirl, breathing and lean all stop and it rests as a still pearl. Otherwise it loops forever, so beside other content for more than 5 seconds WCAG 2.2.2 asks for a pause control.
- **Colour contrast: Not applicable.** No text of its own. Put any words in front of the orb on a solid backing if they need to pass.

## Source

```tsx
"use client";

import { useRef, type ReactNode } from "react";
import { motion, useMotionValue, useReducedMotion, useSpring, useTransform } from "motion/react";

type IridescentOrbProps = {
  /** Four colours that swirl through the pearl. */
  colors?: [string, string, string, string];
  /** Diameter in pixels. */
  size?: number;
  /** Seconds for one full swirl. Larger is calmer. */
  speed?: number;
  /** Lean towards the cursor and roll the highlight with it. */
  interactive?: boolean;
  /** Content floating in front of the orb, such as a logo or a word. */
  children?: ReactNode;
  className?: string;
};

/**
 * A glossy pearl of slowly swirling colour. Two counter-turning gradients mix inside the sphere, a soft highlight and
 * rim light give it depth, it breathes very slightly, and it leans towards the cursor as if it were watching.
 */
export function IridescentOrb({
  colors = ["#5FAEB4", "#B79AD3", "#F2B8A2", "#8FBFB3"],
  size = 220,
  speed = 14,
  interactive = true,
  children,
  className = "",
}: IridescentOrbProps) {
  const reduceMotion = useReducedMotion();
  const ref = useRef<HTMLDivElement>(null);
  const [c1, c2, c3, c4] = colors;

  // pointer position from -1 to 1 across the orb's surroundings
  const px = useMotionValue(0);
  const py = useMotionValue(0);
  const sx = useSpring(px, { stiffness: 90, damping: 18 });
  const sy = useSpring(py, { stiffness: 90, damping: 18 });
  const rotateY = useTransform(sx, [-1, 1], [-14, 14]);
  const rotateX = useTransform(sy, [-1, 1], [14, -14]);
  const shiftX = useTransform(sx, [-1, 1], [-size * 0.06, size * 0.06]);
  const shiftY = useTransform(sy, [-1, 1], [-size * 0.06, size * 0.06]);
  const highlight = useTransform(() => `radial-gradient(circle at ${34 + sx.get() * 10}% ${26 + sy.get() * 10}%, rgb(255 255 255 / 0.75), rgb(255 255 255 / 0.16) 12%, transparent 30%)`);

  const live = interactive && !reduceMotion;
  const swirl = reduceMotion ? undefined : { rotate: 360 };
  const counter = reduceMotion ? undefined : { rotate: -360 };

  return (
    <div
      ref={ref}
      onPointerMove={(event) => {
        if (!live) return;
        const rect = ref.current!.getBoundingClientRect();
        px.set(Math.max(-1, Math.min(1, ((event.clientX - rect.left) / rect.width) * 2 - 1)));
        py.set(Math.max(-1, Math.min(1, ((event.clientY - rect.top) / rect.height) * 2 - 1)));
      }}
      onPointerLeave={() => {
        px.set(0);
        py.set(0);
      }}
      className={`relative flex items-center justify-center ${className}`}
      style={{ minWidth: size * 1.5, minHeight: size * 1.5, perspective: size * 4 }}
    >
      {/* the glow it casts around itself */}
      <motion.div
        aria-hidden
        className="pointer-events-none absolute rounded-full opacity-60 blur-3xl"
        style={{ width: size * 1.15, height: size * 1.15, background: `conic-gradient(from 0deg, ${c1}, ${c2}, ${c3}, ${c4}, ${c1})`, x: shiftX, y: shiftY }}
        animate={swirl}
        transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
      />
      {/* its shadow on the floor */}
      <div aria-hidden className="pointer-events-none absolute rounded-[50%] bg-black/50 blur-xl" style={{ width: size * 0.7, height: size * 0.12, top: `calc(50% + ${size * 0.56}px)` }} />

      <motion.div
        aria-hidden
        className="relative"
        style={{ width: size, height: size, rotateX: live ? rotateX : 0, rotateY: live ? rotateY : 0 }}
        animate={reduceMotion ? undefined : { scale: [1, 1.025, 1], y: [0, -size * 0.03, 0] }}
        transition={{ duration: 6, repeat: Infinity, ease: "easeInOut" }}
      >
        <div className="absolute inset-0 overflow-hidden rounded-full" style={{ background: c1 }}>
          {/* an oversized conic gradient turns slowly; blur scales with the orb so the colours stay distinct at any size */}
          <motion.div
            className="absolute -inset-1/4"
            style={{ background: `conic-gradient(from 90deg at 45% 50%, ${c1}, ${c2}, ${c3}, ${c4}, ${c1})`, filter: `blur(${size * 0.06}px) saturate(1.35)` }}
            animate={swirl}
            transition={{ duration: speed, repeat: Infinity, ease: "linear" }}
          />
          {/* two soft blobs orbit the other way, so where they cross the colour swirls and never quite repeats */}
          <motion.div className="absolute inset-0" animate={counter} transition={{ duration: speed * 0.7, repeat: Infinity, ease: "linear" }}>
            <div className="absolute rounded-full opacity-90" style={{ width: "70%", height: "70%", left: "-10%", top: "5%", background: `radial-gradient(closest-side, ${c3}, transparent)`, filter: `blur(${size * 0.05}px)` }} />
            <div className="absolute rounded-full opacity-80" style={{ width: "65%", height: "65%", right: "-8%", bottom: "-4%", background: `radial-gradient(closest-side, ${c2}, transparent)`, filter: `blur(${size * 0.05}px)` }} />
          </motion.div>
          {/* pearl sheen: a band of pale light that drifts across */}
          <motion.div
            className="absolute -inset-1/4 mix-blend-overlay"
            style={{ background: "linear-gradient(120deg, transparent 32%, rgb(255 255 255 / 0.35) 48%, transparent 60%)" }}
            animate={reduceMotion ? undefined : { x: ["-20%", "20%", "-20%"] }}
            transition={{ duration: speed * 0.6, repeat: Infinity, ease: "easeInOut" }}
          />
          {/* shading: darker underneath, lighter on top, so it reads as a sphere */}
          <div className="absolute inset-0 rounded-full bg-[radial-gradient(circle_at_50%_115%,rgb(4_8_8/0.7),transparent_58%)]" />
          <motion.div className="absolute inset-0 rounded-full" style={{ background: highlight }} />
          <div className="absolute inset-0 rounded-full shadow-[inset_0_0_0_1px_rgb(255_255_255/0.22),inset_-12px_-18px_40px_rgb(0_0_0/0.28),inset_10px_14px_30px_rgb(255_255_255/0.2)]" />
        </div>
      </motion.div>

      {children && <div className="absolute inset-0 flex items-center justify-center">{children}</div>}
    </div>
  );
}
```
