Aurora Background
MotionReact aurora background that drifts soft, blurred bands of accent colour behind a hero, with intensity, speed, blur and colour props. Pauses off screen.
Installation
npx shadcn@latest add @minidev/aurora-background
MiniDev UI is in the shadcn registry directory, so the short form works with no setup. Older CLI versions can use the full URL: npx shadcn@latest add https://ui.minidev.pro/r/aurora-background.json
Usage
import { AuroraBackground } from "@/components/ui/aurora-background"
export function Example() {
return (
<AuroraBackground />
)
}
API reference
| Prop | Type | Default |
|---|---|---|
| intensityStrength of the light, 0 to 1. | number | 1 |
| speedSpeed multiplier. 2 is twice as fast, 0.5 half as fast. | number | 1 |
| blurSoftness of the bands in pixels. | number | 28 |
| colorsColours of the bands. Any CSS colour, including var(--token). | string[] | ["var(--accent)", "var(--accent-2)", ... |
| className | string | - |
| children | React.ReactNode | - |
When to use
Use it as a hero or CTA backdrop; children render on top. For a static glow use HeroGradientMesh, for a pointer-reactive grid use BackgroundBoxes.
Accessibility
- The light layer is
aria-hiddenandpointer-events-none, so only your content is read and clickable. - Under reduced motion the three curtains are held still at a small fixed offset instead of swaying.
- Text sits directly on moving colour, so check contrast of your heading against the brightest band at your chosen
intensity.
Frequently asked questions
How do I make the aurora fill my hero?
Set the height in className: the default is h-[360px], so use h-[480px] or min-h-svh. Your children render in a relative z-10 h-full layer above the light. With no children it shows a sample headline and button.
How do I change the aurora colours or make it subtler?
Pass colors (any CSS colour, including var(--token)) and lower intensity. Light mode runs at 64% of intensity and dark mode at 100%, so one value suits both themes. blur={0} gives hard-edged bands.
Does it cost anything when it is off screen?
The CSS animation is paused (animationPlayState: "paused") when the panel is more than 80px outside the viewport. Only transform animates; the blur filter is static.
Dependencies
npm
Built from
Examples
Custom content
Children sit above the light and keep the pointer; size the panel with className.
Colours and intensity
colors takes any CSS colours, tokens included; intensity above 1 pushes the light harder.
Slow and sharp
speed 0.5 halves the sway and a low blur keeps the edges of the bands visible.