Skip to Content
zjkm-ui
Components

Aurora Gradient

A slowly shifting aurora gradient.

Ship faster

Props
12s
60px
<AuroraGradient>
  <Hero />
</AuroraGradient>

Installation

npx shadcn@latest add https://ui.zjkm.tech/r/aurora-gradient.json
import { AuroraGradient } from "@/components/aurora-gradient"

Using JavaScript? Set tsx: false in components.json and the CLI converts it.

New to shadcn? Run npx shadcn@latest init first. The CLI needs components.json and the @/ import alias.

Usage

Soft, blurred fields of colour drift slowly behind your content. It's pure CSS. Give the wrapper a dark background for the classic aurora look.

import { AuroraGradient } from "@/components/aurora-gradient";

export function Hero() {
  return (
    <AuroraGradient className="rounded-2xl bg-neutral-950 p-16" colors={["#22d3ee", "#a78bfa", "#34d399"]}>
      <h1 className="text-white">Ship faster</h1>
    </AuroraGradient>
  );
}

Props

PropTypeDefaultDescription
childrenReactNodeContent shown over the aurora.
colors[string, string, string]["#22d3ee", "#a78bfa", "#34d399"]The three colour fields.
speednumber12Seconds per drift.
blurnumber60Blur in pixels.
classNamestringClasses for the wrapper.

With reduced motion, the colours stay still.

On this page