# Aurora Background

> React aurora background that drifts soft, blurred bands of accent colour behind a hero, with intensity, speed, blur and colour props. Pauses off screen.

- Kind: Motion component (Motion)
- Docs: https://ui.minidev.pro/docs/aurora-background
- Source (registry JSON with the full file): https://ui.minidev.pro/r/aurora-background.json
- License: MIT. One file, yours to edit after install.

## 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.

## Installation

### shadcn CLI (copies the source into your project)

```bash
npx shadcn@latest add @minidev/aurora-background
```

Writes `components/ui/aurora-background.tsx` plus the MiniDev files it is built from (button) and installs its npm dependencies. Older CLI versions: `npx shadcn@latest add https://ui.minidev.pro/r/aurora-background.json`.

### npm package

```bash
npm i minidev-ui-kit lucide-react motion
```

Add the tokens to your global stylesheet once:

```css
@import "tailwindcss";
@import "minidev-ui-kit/styles.css";
@source "../node_modules/minidev-ui-kit";
```

Next.js also needs `transpilePackages: ["minidev-ui-kit"]` in next.config.

## Import

After the shadcn install:

```tsx
import { AuroraBackground } from "@/components/ui/aurora-background"
```

From the npm package:

```tsx
import { AuroraBackground } from "minidev-ui-kit/premium/aurora-background"
```

## Usage

```tsx
import { AuroraBackground } from "@/components/ui/aurora-background"

export function Example() {
  return (
    <AuroraBackground />
  )
}
```

## Props

| Prop | Type | Default | Required | Description |
| --- | --- | --- | --- | --- |
| `intensity` | `number` | `1` | no | Strength of the light, 0 to 1. |
| `speed` | `number` | `1` | no | Speed multiplier. 2 is twice as fast, 0.5 half as fast. |
| `blur` | `number` | `28` | no | Softness of the bands in pixels. |
| `colors` | `string[]` | `["var(--accent)", "var(--accent-2)", ...` | no | Colours of the bands. Any CSS colour, including var(--token). |
| `className` | `string` | - | no |  |
| `children` | `React.ReactNode` | - | no |  |

## Examples

### Custom content

Children sit above the light and keep the pointer; size the panel with className.

```tsx
<AuroraBackground className="h-80">
  <div className="flex h-full flex-col items-center justify-center gap-4 px-6 text-center">
    <p className="text-xs font-medium tracking-[0.06em] text-accent-fg uppercase">Northwind annual report</p>
    <p className="max-w-[20ch] text-3xl font-medium tracking-[-0.035em] text-balance text-fg">A year of closing the books on time</p>
    <div className="flex flex-wrap justify-center gap-2">
      <Button>Read the report <ArrowRightIcon /></Button>
      <Button variant="outline">Download PDF</Button>
    </div>
  </div>
</AuroraBackground>
```

### Colours and intensity

colors takes any CSS colours, tokens included; intensity above 1 pushes the light harder.

```tsx
<AuroraBackground colors={["var(--success)", "var(--info)", "var(--accent)"]} intensity={1.3} className="h-64" />
```

### Slow and sharp

speed 0.5 halves the sway and a low blur keeps the edges of the bands visible.

```tsx
<AuroraBackground speed={0.5} blur={10} className="h-64" />
```

## Accessibility

- The light layer is `aria-hidden` and `pointer-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`.

## FAQ

### 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.

## Rules for generating code

- Use semantic tokens only (bg, surface, sunken, border, fg, fg-muted, fg-subtle, ink, accent, success, warning, danger). Never raw hex or palette steps like blue-500.
- Shadows only from the set: shadow-xs, shadow-sm, shadow-raised, shadow-md, shadow-lg, shadow-overlay.
- Numbers use tabular-nums. Dark mode is the `dark` class on <html>; components never branch on theme.

## Dependencies

- npm: `lucide-react`, `motion`
- Built from: [button](https://ui.minidev.pro/docs/button/md)

## Related

- [Hero Gradient Mesh](https://ui.minidev.pro/docs/hero-gradient-mesh/md): A dark hero on a layered radial gradient mesh with a scale in headline, supporting copy and high contrast launch and docs buttons for launch pages.
- [Background Boxes](https://ui.minidev.pro/docs/background-boxes/md): React background of skewed hairline boxes: the box under the pointer lights up in colour and fades out, driven by one pointer handler and CSS transitions.
- [Hero Aurora](https://ui.minidev.pro/docs/hero-aurora/md): A React hero with slow drifting aurora gradient blobs behind an eyebrow, headline, description and two action buttons that fade up in sequence.
- [Light Field](https://ui.minidev.pro/docs/light-field/md): A WebGL shader background of drifting color silk with a soft cursor light and grain. It renders at half resolution, pauses offscreen and adapts to dark mode.
- [Wavy Background](https://ui.minidev.pro/docs/wavy-background/md): React canvas background of layered sine waves rolling behind your content, with colour, speed, amplitude and blur props, sharp on retina and paused off screen.
- [Animated Feature Row](https://ui.minidev.pro/docs/animated-feature-row/md): A row of feature cards that slide up with a staggered delay when scrolled into view. Pass title and description pairs; reduced motion keeps them still.

---

All 557 components: https://ui.minidev.pro/llms.txt (full text: https://ui.minidev.pro/llms-full.txt).
