shadcn.io is not affiliated with official shadcn/ui
Five color blobs, teal, purple, blue, pink and violet, wander and overlap behind your content under a fine film grain, so the blends keep changing. Each blob is a radial gradient whose stops ease out to transparent, so it looks blurred without a blur filter. It sways on each axis at its own pace with CSS keyframes, so its path never quite repeats, and it moves with transforms, which the browser composites without repainting. Blobs are placed and sized from the component's box, not the window, so it works in a card as well as full screen. There's no script.
Use it when a hero should feel lively. For something calmer, with faint orbs that barely move, use Mesh Gradient; for something bigger, with very large fields that orbit and blend into new hues, Gradient Animation; for color in drifting bands, Aurora; for blobs that merge like a lava lamp, Metaballs. With reduced motion the blobs stand still.
Installation
Usage
import { Gradient } from "@/components/ui/gradient";<Gradient className="flex min-h-[32rem] items-center justify-center">
<h1 className="text-5xl font-semibold">Color that keeps moving</h1>
</Gradient>Gradient is a container: whatever you put inside sits on top of the color, in normal flow. It fills its own box, so give it a height or content. For a backdrop behind the whole page, render it empty with className="fixed inset-0 -z-10".
Demos
Colors
colors takes up to five CSS colors, repeated when there are fewer; here amber, rose, orange, fuchsia and red. Theme variables such as var(--primary) work too.
In a card
intensity="subtle" pales the blobs and grain={false} removes the grain. The blobs are sized from the box, so a card gets the whole composition, not a corner of it.
Accessibility
The blobs are decoration: they're hidden from assistive tech and let every click through to your content. With reduced motion they stop where they are, and the colors stay as a still picture. Nothing flashes.
Put copy over it in your foreground color (text-foreground), the supporting lines too. Where the blobs overlap most it stays above 5:1 in both color schemes at the default intensity, but a muted color drops to about 2:1, which fails for text of any size.
FAQ
Which colors does it use?
Teal, purple, blue, pink and violet by default. Pass up to five CSS colors to colors, in any format, or set --gradient-color-1 to --gradient-color-5 in your CSS.
How do the blobs move?
Each blob sways sideways and up and down at two different paces, between 15 and 26 seconds a round trip, so its path never quite repeats and the overlaps keep changing. speed multiplies the pace: 2 is twice as fast.
What's the texture?
A still noise tile at low opacity, drawn once by the browser and repeated, so it stays fine at any size. It gives the gradients a film look and hides banding; grain={false} removes it.
How is it different from Mesh Gradient?
This one is brighter, its blobs roam the middle of the box and move in seconds, and its grain shows. Mesh Gradient's orbs are fainter, sit near the corners and take a minute or more per loop.
Can I put it in a card?
Yes. Blob sizes and positions follow the component's box, not the window, so a small card shows all five blobs.
API Reference
Gradient
<div> data-slot="gradient"
colors?string[]
Up to five CSS colors for the blobs, repeated when there are fewer. By default teal, purple, blue, pink and violet.
grain?boolean
A fine film grain over the surface.
- Default
true
intensity?"subtle" | "medium" | "strong"
How strongly the blobs show over the surface.
- Type
"subtle" | "medium" | "strong"- Default
"medium"
speed?number
How fast the blobs wander: 2 is twice as fast, 0.5 half as fast.
- Default
1
render?ReactElement | ((props: object, state: object) => ReactElement)
Replace the host element or compose it with another component.
- Type
ReactElement | ((props: object, state: object) => ReactElement)
className?string
Merged with the part's classes.
--gradient-color-1string
The first blob (teal).
--gradient-color-2string
The second blob (purple).
--gradient-color-3string
The third blob (blue).
--gradient-color-4string
The fourth blob (pink).
--gradient-color-5string
The fifth blob (violet).
--gradient-speedstring
The wander's speed, a multiplier (1).
--gradient-strengthstring
The blobs' strength, a multiplier of their alpha (1).
Related


Mesh Gradient Background
GradientsThe calm, corner-anchored version
- Pro


Gradient Animation Background
GradientsVery large soft fields that orbit and blend
- Pro


Grain Background
TextureThe grain on its own, animated
- Pro


Metaballs Background
GradientsBlobs that merge and split like a lava lamp
- Pro


Watercolor Background
GradientsWatercolour washes on paper instead of blobs


Aurora Background
SpaceColour in drifting bands