Introducing Nuvyx UI v1.0.0

Docs
Animated Gradient Background

Animated Gradient Background

A dynamic animated gradient background component that supports various gradient patterns.

Installation

Usage

import { AnimatedGradientBg } from "@/components/ui/animated-gradient-bg";
<div className="relative h-[500px] w-full overflow-hidden bg-transparent">
  <div className="absolute inset-0">
    <AnimatedGradientBg
      pattern="radial"
      position="absolute"
      size="full"
      zIndex={0}
      colors={["#3b82f6", "#2563eb", "#1d4ed8", "#1e40af"]}
    />
  </div>
  <div className="relative z-10 flex h-full items-center justify-center text-white">
    <div className="p-4 text-center">Animated gradient</div>
  </div>
</div>

Props

PropTypeDefaultDescription
childrenReact.ReactNodeundefinedContent to render on top of the gradient background.
classNamestring""Additional CSS classes to apply to the container.
colorsstring[]initialColorsArray of colors to use in the gradient.
speednumber1Speed factor for the gradient animation.
blurnumber60Blur effect applied to the background.
patternstring"radial"The gradient pattern (radial, linear, conic, mesh, noise, waves).
intensitynumber1Intensity of the gradient pattern.
opacitynumber0.8Opacity of the background.
sizestring"full"Size of the background container (sm, md, lg, full, number).
positionstring"absolute"CSS position property (fixed, absolute, relative).
zIndexnumber-1z-index of the background container.
animatebooleantrueEnable or disable background animation.
asReact.ElementType"div"HTML element or component to render as (div, section, etc.).
onClick() => voidundefinedClick event handler for the background.