Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Backgrounds

Pro

Supernova Background for React

The glowing remnant of an exploded star, larger than the box: braided filaments round a hot core, a shell that keeps growing and soft shock waves running out. For React with Base UI, when a launch or announcement hero should feel vast and alive without stealing the headline.

Framework

Supernova shows what's left long after a star explodes: a vast shell of glowing filaments, rose braids at the rim with patchy gas along them, teal wisps inside and a hot core up in the corner, larger than the box, over a field of stars. The shell keeps growing, two sets of filaments grow and cross-fade in turn so it never jumps back; soft shock waves run out from the core, one always in flight; and the core pulses gently. The filaments are a drawing the browser rasterises once, and everything moves by scale and opacity, with no canvas and no script. It's ink on paper on a light page and deep space on a dark one.

Use it on launch or announcement heroes, and on pages that should feel vast. For clouds of coloured gas use Nebula; for flying through stars, Starfield; for celebration, with falling trails, Fireworks.

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Usage

import { Supernova } from "@/components/ui/supernova";
<Supernova className="flex min-h-[440px] items-center justify-center">
  <h1 className="text-5xl font-semibold">Launch day</h1>
</Supernova>

Supernova is a container: whatever you put inside sits on top of the sky, in normal flow. The remnant's core sits in the top corner on the end side (top left on a right-to-left page) and its rim sweeps across the box, sized from the box's diagonal, so it frames a card as well as a hero. For the whole page, render it empty with className="fixed inset-0 -z-10".

Demos

In a card

intensity="subtle" dims the remnant so a block of text can sit on top, and stars sets how many stars fill the sky.

Preview width

Colors

colors takes up to four colours: the rim, the knots between, the wisps inside, and the core with its shock waves. The container's dark class and bg-background keep this scene dark in both colour schemes.

Preview width

Accessibility

The sky is decorative: it's hidden from screen readers and never takes the pointer, and your content stays on top in normal flow. Nothing flashes: the shells fade in and out over 40 seconds, the shock waves over 14, and the core's pulse is a gentle swell every 7 seconds. With reduced motion nothing moves: the remnant holds still, a shell and a shock wave mid-way out.

Keep text in your foreground colour. The interior of the shell is a soft wash, so a centred headline keeps its contrast in both themes; the core's glow is brightest, so keep small text away from the top corner on the end side, or use intensity="subtle".

FAQ

What is it showing?

A supernova remnant: the shell of gas a star throws off when it explodes, seen centuries later, like the Veil Nebula or Cassiopeia A. Rose filaments braid along the rim, where the shock hits the surrounding gas, teal wisps fill the inside, and the collapsed core still glows.

How does it move?

Two sets of filaments, the same drawing turned half a turn, take turns: each grows from 80% to full size over 40 seconds while it fades in and out, so the shell keeps expanding and never jumps back. Two soft shock waves run out from the core, half a cycle apart, and the core swells gently. All of it is scale and opacity, which the browser's compositor animates off the main thread.

Can I change the colours?

Pass colors, up to four CSS colours: the rim, the knots between, the wisps inside, and the core with its shock waves. Related hues work best. You can also set --supernova-color-1 to --supernova-color-4 in your CSS. By default they're deeper inks on a light page and brighter light on a dark one.

Will it fight my headline?

No: the core sits in the top corner on the end side, the rim sweeps across the box, and the inside of the shell is a soft wash. Use intensity="subtle" behind dense copy.

How do I change the speed?

speed multiplies everything: 2 grows the shells and runs the shock waves twice as fast, 0.5 half as fast. You can also set --supernova-speed in your CSS.

Does it slow the page down?

No script runs. The filaments are one drawing, rasterised once, and the moving parts are a handful of layers that only scale and fade, so the compositor does the work. Each layer is sized to what it can show as it grows, not to the whole remnant, which keeps its memory small.

API Reference

Supernova

<div> data-slot="supernova"

PropType
colors?string[]

Up to four CSS colours: the shell's rim, the knots between, the wisps inside and the core with its shock rings, repeated when there are fewer. By default rose, amber, teal and a hot white core, as deeper inks on a light page.

intensity?"subtle" | "medium" | "strong"

How strongly the remnant glows over the sky.

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

How fast the shells grow and the shock rings travel: 2 is twice as fast, 0.5 half as fast.

Default
1
stars?number

How many stars fill the sky, from 0 to 400; about one in five twinkles. @default 160.

Default
160
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
--supernova-color-1string

The shell's rim (rose).

--supernova-color-2string

The knots between (amber).

--supernova-color-3string

The wisps inside and the haze (teal).

--supernova-color-4string

The core and the shock rings (hot white; teal ink on a light page).

--supernova-skystring
--supernova-speedstring

How fast it grows, a multiplier (1).

All 100 backgrounds