Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Backgrounds

Free

Aurora Background for React

Soft curtains of green light that drift across a box, like the northern lights. For React with Base UI, when a hero or a sign-up section needs color and slow motion behind its copy.

Framework

Soft curtains of green light drift across the top of the box, like the northern lights, and fade out toward the opposite corner, so the copy on top stays easy to read. Two layers of tilted color bands slide past each other in opposite directions, each by exactly one stripe, so the loop never jumps. They move with CSS transforms, which the browser composites without repainting, and there's no blur filter and no script: it's markup and CSS keyframes the install adds to your stylesheet.

Use it behind a hero, a sign-up section or a launch card. For calm color blobs instead of bands, use Mesh Gradient; for bands that flow as waves, Light Waves; for a night sky, Starfield. With reduced motion the curtains stand still.

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.
Use email insteadNo credit card

Usage

import { Aurora } from "@/components/ui/aurora";
<Aurora className="flex min-h-[32rem] items-center justify-center">
  <h1 className="text-5xl font-semibold">Ship faster</h1>
</Aurora>

Aurora is a container: whatever you put inside sits on top of the light, 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 violet, cyan and pink. The surface is the root's own background, bg-background by default, and nothing in the light depends on it, so a className such as bg-slate-950 gives it a night sky.

Preview width

In a card

fade={false} fills the whole box instead of fading from the corner, intensity="subtle" pales it, and speed={2} drifts twice as fast. The stripes scale with the box, so the light works at card size too.

Preview width

Accessibility

The light is decoration: it's hidden from assistive tech and lets every click through to your content. With reduced motion both layers stop where they are, and a still aurora stays. Nothing flashes.

Put copy over it in your foreground color (text-foreground), the supporting lines too. The brightest curtain behind the text keeps it above 4.5:1 at the default intensity in both color schemes, but a muted color falls to about 2:1 on a dark surface, and intensity="strong" on a dark surface brings even the foreground color down to about 3.4:1, so keep small text off it there.

FAQ

How do I make it faster or slower?

speed multiplies the drift: 2 is twice as fast, 0.5 half as fast. At 1 the front layer moves one stripe every 10 seconds and the back layer one every 17, so the bright crossings wander and never repeat in step.

Will it slow my page down?

No. Two layers slide with translate, which the browser composites without repainting, and there's no blur filter and no JavaScript. The price is a few layers' worth of GPU memory, as for any animated layer the size of the screen.

Can I use my brand colors?

Yes. Pass up to five CSS colors to colors, such as var(--primary); fewer are repeated. You can also set --aurora-color-1 to --aurora-color-5 in your CSS.

Does it work in light and dark mode?

Yes. It's the same palette in both, paler on a light surface and brighter on a dark one, with no invert filter. The surface is the root's background, so bg-slate-950 or your own color works the same way.

What does fade do?

It fades the light out from the top corner at the end of the line, top right, or top left on a right-to-left page. fade={false} fills the whole box.

How do I put it behind the whole page?

Render it empty with className="fixed inset-0 -z-10". To put it behind one section, wrap that section's content in it and give it a height, such as min-h-svh.

What happens with reduced motion?

Both layers stop where they are, so the curtains stay on screen as a still picture.

API Reference

Aurora

<div> data-slot="aurora"

PropType
colors?string[]

Up to five CSS colors for the curtains, repeated when there are fewer. By default emerald, mint and teal; pass theme variables such as var(--primary) to follow your theme.

fade?boolean

Fades the aurora out from the top corner on the end side (top right, top left on a right-to-left page); false fills the whole box.

Default
true
intensity?"subtle" | "medium" | "strong"

How strongly the curtains show over the surface.

Type
"subtle" | "medium" | "strong"
Default
"medium"
speed?number

How fast the curtains drift: 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.

CSS variableType
--aurora-color-1string

The first curtain color (emerald).

--aurora-color-2string

The second curtain color (bright emerald).

--aurora-color-3string

The third curtain color (mint), the brightest.

--aurora-color-4string

The fourth curtain color (light teal).

--aurora-color-5string

The fifth curtain color (teal).

--aurora-speedstring

The drift's speed, a multiplier (1).

All 100 backgrounds