Gradient Background
animate-ui/components-backgrounds-gradientFreeComponent
A background component featuring a subtle yet engaging animated gradient effect, smoothly transitioning colors to enhance visual depth.
Install it
npx shadcn@latest add https://animate-ui.com/r/components-backgrounds-gradient.jsonSource
1'use client';23import * as React from 'react';4import { motion, type HTMLMotionProps } from 'motion/react';56import { cn } from '@/lib/utils';78type GradientBackgroundProps = HTMLMotionProps<'div'>;910function GradientBackground({11 className,12 transition = { duration: 15, ease: 'easeInOut', repeat: Infinity },13 ...props14}: GradientBackgroundProps) {15 return (16 <motion.div17 data-slot="gradient-background"18 className={cn(19 'size-full bg-gradient-to-br from-blue-500 via-purple-500 to-pink-500 bg-[length:400%_400%]',20 className,21 )}22 animate={{ backgroundPosition: ['0% 50%', '100% 50%', '0% 50%'] }}23 transition={transition}24 {...props}25 />26 );27}2829export { GradientBackground, type GradientBackgroundProps };
What it pulls in
npm packages
Files it writes
More from Animate UI
All 580 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Avatar Groupcomponents-animate-avatar-group | Animate UI | Components | Free | 1 dep | |
| Codecomponents-animate-code | Animate UI | Components | Free | 1 dep | |
| Code Tabscomponents-animate-code-tabs | Animate UI | Components | Free | 1 dep | |
| Cursorcomponents-animate-cursor | Animate UI | Components | Free | no deps | |
| GitHub Stars Wheelcomponents-animate-github-stars-wheel | Animate UI | Components | Free | 1 dep | |
| Tabscomponents-animate-tabs | Animate UI | Components | Free | no deps | |
| Tooltipcomponents-animate-tooltip | Animate UI | Components | Free | 1 dep | |
| Bubble Backgroundcomponents-backgrounds-bubble | Animate UI | Components | Free | 1 dep |
