UIPin
ComponentsIconsIllustrationsMotionTemplatesApps
Boards
UIPin

Free, open-source UI components, icons, illustrations, motion, templates and apps, in one search. Every item links to its source and licence.

UIPin is free. If it saved you time, you can keep it running:

Buy me a coffee
ComponentsIconsIllustrationsMotionTemplatesAppsLibrariesCompareNew this weekMCP for agentsBoardsPrivacy

Components, icons and artwork belong to their authors and are shown under their open-source licences.

Cult UI/Bg Animated Gradient

Backgrounds
1 of 2
Compiling

Theme it

Every preview, live

Brand colour

Corner radius

Font

Recolours shadcn’s tokens, Tailwind’s accent colours and colours set in the code. Red, amber and green classes stay, since they usually mean error, warning or success.

2 versions·2 libraries

  • Cult UI
  • Animate UI

Bg Animated Gradient

Animated gradient background component with customizable color transitions

npx shadcn@latest add https://cult-ui.com/r/bg-animated-gradient.json
Open in v0 Docs Repo
Library
Cult UI
License
MIT
Stack
React · Tailwind CSS · animated · radix
Packages
cnmotionradix-ui
Also adds
accordion, button, card, input, label, slider, tabs
Size
56 lines
Demo
From Cult UI

Code

registry/default/ui/bg-animated-gradient.tsx

"use client"

import React, { useEffect } from "react"
import { motion, useAnimation } from "motion/react"

interface GradientStop {
  color: string
  position: number
}

interface GradientType {
  stops: GradientStop[]
  centerX: number
  centerY: number
}

interface GradientAnimationProps {
  gradients: GradientType[]
  animationDuration: number
  className?: string
}

export const GradientAnimation: React.FC<GradientAnimationProps> = ({
  gradients,
  animationDuration,
  className = "",
}) => {
  const controls = useAnimation()

  useEffect(() => {
    controls.start({
      background: gradients.map(
        (g) =>
          `radial-gradient(circle at ${g.centerX}% ${g.centerY}%, ${g.stops
            .map((s) => `${s.color} ${s.position}%`)
            .join(", ")})`
      ),
      transition: {
        duration: animationDuration,
        repeat: Infinity,
        repeatType: "reverse",
        ease: "linear",
      },
    })
  }, [controls, gradients, animationDuration])

  return (
    <motion.div
      className={`absolute inset-0 h-full w-full ${className}`}
      animate={controls}
    />
  )
}

export default React.memo(GradientAnimation)

More like this

Glow Effect

Motion Primitives·Cursor & effects

Hole Background

Animate UI·BackgroundsMIT+

Bg Animated Fractal Dot Grid

Cult UI·Page sections

Laser Flow

React Bits·BackgroundsMIT+

Bubble Background

Animate UI·BackgroundsMIT+

Shape Hero

Kokonut UI·Page sections

Cobe Globe

Eldora UI·Media & 3D

Safari Browser

Eldora UI·Media & 3D

Strands

React Bits·BackgroundsMIT+

Shader Lens Blur

Cult UI·Cursor & effects

Cubes

React Bits·BackgroundsMIT+

Canvas Fractal Grid

Cult UI·Page sections

Grid Pattern

Magic UI·Backgrounds

Svg Ripple Effect

Eldora UI·Backgrounds

Meta Balls

React Bits·NavigationMIT+