Join our Discord Community

React Background Circles

Rotating circles that hypnotize like a mandala in motion. Build mesmerizing React backgrounds with smooth orbital animations, TypeScript support, and eight color themes for Next.js applications with shadcn/ui.

Powered by

Trying to implement hypnotic animations?

Join our Discord community for help from other developers.


Ever stared at a loading spinner until you forgot what you were waiting for? This React component takes that hypnotic quality and turns it into a full background. Concentric circles rotating in opposite directions, creating an endless mandala effect that's somehow both calming and captivating.

Orbital rotation animation

Watch circles orbit in perfect harmony with customizable colors:

Loading component...

Built for React applications with TypeScript and Next.js. The circles use Framer Motion for butter-smooth 5-second rotation cycles with subtle scale effects. Eight color variants let you match any mood—from zen emerald to energetic fuchsia.

Installation

npx shadcn@latest add https://www.shadcn.io/registry/background-circles.json
npx shadcn@latest add https://www.shadcn.io/registry/background-circles.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/background-circles.json
bunx shadcn@latest add https://www.shadcn.io/registry/background-circles.json

Usage

import { BackgroundCircles } from "@/components/ui/background-circles";

export default function Hero() {
  return (
    <BackgroundCircles 
      title="Welcome"
      description="To the hypnotic zone"
      variant="primary"
    />
  );
}

Why most circle animations feel mechanical

Most developers just rotate divs with transform: rotate(). It works, but it feels robotic. No depth, no life, just circles spinning like clock hands. Some add opacity changes, but that's just circles fading in and out.

This React component creates depth with counter-rotation—inner circles rotate opposite to outer ones. Add subtle scale animations and gradient overlays, and suddenly those circles feel alive. The diagonal grid background adds another layer of movement, creating that mandala effect that keeps eyes locked.

Features

  • Eight color themes from calming emerald to vibrant fuchsia
  • 5-second rotation cycles with counter-rotating layers
  • Subtle scale animations creating breathing effect
  • Diagonal grid overlay adding depth and texture
  • TypeScript support with complete type definitions
  • Responsive scaling capped at 80vh/80vw for any screen
  • Hardware-accelerated CSS transforms via Framer Motion
  • shadcn/ui compatible using Tailwind CSS design tokens

API Reference

BackgroundCircles

Main container component for the rotating circles effect.

PropTypeDefaultDescription
titlestring"Background Circles"Main text displayed in center
descriptionstring"Optional Description"Subtext below the title
classNamestring-Additional Tailwind CSS classes
variantColorVariant"octonary"Color theme selection

Color Variants

type ColorVariant = 
  | "primary"    // Emerald and cyan
  | "secondary"  // Violet and fuchsia  
  | "tertiary"   // Orange and yellow
  | "quaternary" // Purple and pink
  | "quinary"    // Red and rose
  | "senary"     // Blue and sky
  | "septenary"  // Gray monochrome
  | "octonary"   // Alternative red and rose

Common gotchas

Text gets lost: The circles can overwhelm text. Use high contrast colors or add a semi-transparent overlay div between circles and content.

Performance on mobile: Multiple rotating layers with gradients can lag on older phones. Consider reducing circles or disabling on low-end devices.

Viewport scaling issues: The 80vh/80vw max prevents circles from extending beyond viewport, but very wide screens might show gaps. Test on ultrawide monitors.

Color variant naming: The variants use ordinal names (primary, secondary, tertiary...). Remember quaternary is 4th, quinary is 5th, etc.

Animation smoothness: If animations stutter, check for other heavy processes. Framer Motion uses will-change but competing animations can still cause issues.

You might also like

Explore other animated background components for React applications:

Questions developers actually ask