Ribbons of iridescent glass drifting through the dark, twisting to bright edges side-on and blooming with colour face-on, like light on a soap film.
A glossy pearl of slowly swirling colour that breathes, catches the light and leans towards the cursor. A calm centrepiece for a hero.
Customize
Usage
import { IridescentOrb } from "@/components/motionkit/iridescent-orb";
<IridescentOrb size={240} />Motion
The exact curves this component runs, plotted with Motion's own maths.
Swirl
Runs on its own
Breathe
Runs on its own
Lean
Pointer moves
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.
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.
Works in the App Router as is. Requires Tailwind CSS v4.
One command adds the file and installs its dependencies. Needs a components.json (run npx shadcn@latest init once if you don't have one).
npx shadcn@latest add https://www.motionkitui.com/r/iridescent-orb.jsonnpm install motionSave as components/motionkit/iridescent-orb.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>
);
}
| 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. |
How we audit: the WCAG 2.2 animation checklist and respecting reduced motion in React.
Yes. The file starts with "use client", so you can import it straight into a Server Component page or layout. It works in Vite as is, and in Astro as a React island.
Only the motion package, beside React and Tailwind CSS v4. There is no MotionKit package and no Tailwind config to add.
Yes. Run npx shadcn@latest add https://www.motionkitui.com/r/iridescent-orb.json in any project with a components.json. It saves the file to components/motionkit and installs its dependencies.
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.
Ribbons of iridescent glass drifting through the dark, twisting to bright edges side-on and blooming with colour face-on, like light on a soap film.
Thousands of fine dots forming a slowly turning 3D sphere with a ripple across its surface, drifting aside from the cursor.
A retro perspective grid rolling toward a glowing horizon, synthwave style.