Skip to content

shadcn.io is an independent project built on shadcn/ui

Pro

Supernova Background for Solid

Long thin rays burst from a bright core, with a soft shock ring around it. For Solid with Ark UI, when a launch page needs one point of light.

On this page10 sections
UI library: Ark UI

A burst of light: long thin rays leave a bright core at uneven angles, each tapering to its tip and wavering on its own slow beat, finer rays turn the other way between them, and a soft shock ring stands around the core with a fainter echo further out. It's a GLSL scene on WebGL2 with no dependency. On a dark surface it glows; on a light one the rays and the ring are drawn in ink and the core is left as paper. The origin leans toward the pointer, and a press sends a ring out from the core.

Use it behind a launch hero, a release card or a pricing band, with the burst on one edge and the copy on the other side of the box. For wide shafts of light that fan down through haze, use Corona; for a dark disc with a bright rim, Eclipse; for streaks that rush out of a vanishing point, Warp. With reduced motion it holds one still frame.

Playground
Supernova Background, still
Customize

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 class="flex min-h-[36rem] flex-col items-center pt-20">
  <h1 class="text-5xl font-semibold">Your release notes, written as you merge</h1>
</Supernova>

Supernova is a container: whatever you put inside sits on top of the burst, 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".

Presets

Novathe default lookTry it
<Supernova />
EmberTry it
<Supernova
  colors={["#fff1c9", "#ff8a3c", "#e0304a", "#6b1235"]}
  glow={1}
  length={0.8}
  radius={0.22}
  rays={90}
  ring={1.6}
/>
HaloTry it
<Supernova
  colors={["#ffffff", "#c4b5fd", "#818cf8"]}
  core={0.6}
  glow={0.8}
  length={0.6}
  radius={0.6}
  rays={24}
  ring={2}
/>
MonoTry it
<Supernova
  colors={["var(--foreground)", "var(--muted-foreground)"]}
  glow={0.2}
  rays={32}
  ring={0.6}
/>
PulsarTry it
<Supernova
  colors={["#ffffff", "#8be9fd", "#6272ff"]}
  core={1.6}
  length={1.4}
  lineWidth={2.6}
  origin="center"
  rays={16}
  ring={0}
  shimmer={1}
  spin={3}
/>
ZenithTry it
<Supernova
  colors={["#f0fbff", "#7fd4ff", "#5b7cff", "#a04dff"]}
  lineWidth={1.2}
  origin="top"
  radius={0.45}
  rays={120}
/>

Each preset is a set of props, so copy one and keep tuning. Nova is the default. Zenith hangs 120 fine, cold rays from the top edge. Pulsar puts 16 thick rays in the middle of the box with no ring, turning three times as fast, for a backdrop with no copy on it. Halo shortens the rays and doubles the ring, so the ring is the subject. Mono takes its colors from your theme.

Examples

Hero

No props are set. The default origin, bottom, puts the core on the bottom edge, so the copy sits in the upper half, above the ring, where only the thin ends of the rays pass.

Preview width

Pulsar

The Pulsar preset on a dark surface: origin="center", rays={16} at lineWidth={2.6}, a larger core={1.6}, ring={0}, and spin={3} with shimmer={1} so the rays turn and waver more.

Preview width

In a card

origin="top" turns the burst over, so the rays fall from the top of the card and the text sits at the bottom. length={0.8} keeps them short of the text, radius={0.4} widens the ring, and grain adds film grain.

Preview width

Customization

colors takes two to eight CSS colors, from the core out to the tips of the rays; the ring and the soft light around the core take theirs from further along the same list. Theme variables work and follow a theme switch: colors={["var(--foreground)", "var(--chart-1)"]}. The palette is mixed in OKLab, so two distant hues meet in a clean color.

The surface is the root's own background, bg-background by default. Give the root another (bg-slate-950, bg-amber-50) and the burst adapts: it adds light to a dark surface, and on a light one it draws the rays and the ring in a darker ink of each color and leaves the core as bare paper. fade masks an edge, opacity turns the whole effect down, and grain adds film grain.

<Supernova
  class="min-h-[32rem] bg-slate-950"
  colors={["#ffffff", "var(--chart-1)", "var(--chart-2)"]}
  fade="top"
  grain={0.15}
/>

Performance

It's one WebGL2 canvas and one fragment shader. Each pixel looks at the three nearest rays of each of the two sets, so the cost doesn't grow with rays, and takes seven samples of simplex noise: six for the light that runs out along the rays and one for the ring. There are no march steps. It draws only while it's on screen and the tab is visible, shares one frame loop with every other background on the page, and lowers its own resolution if frames run long. quality sets the render scale yourself, and paused holds the frame.

Accessibility

The burst is decoration: it's hidden from assistive tech and lets every click through to your content. With reduced motion it draws one still frame and ignores the pointer and presses.

Nothing flashes. Each ray changes brightness on its own beat of 5 to 21 seconds, the rays turn once in about 9 minutes, and a press swells the core by half for under a second. Keep copy off the core: on a dark surface it's white. With the default look, 99.9% of the upper 60% of the box leaves text in the foreground color (text-foreground) above 7:1 on a dark surface and 13:1 on a light one; the rest is rays 1 to 2 pixels wide.

FAQ

How do I change the colors?

Pass two to eight CSS colors to colors. The first is the core and the last is the tips of the rays. The ring takes its color from a little further along the list than the rays at the same distance, so it stands apart from them. Hex, oklch() and theme variables such as var(--primary) all work, and a variable follows your theme when it changes.

Does it work on a light page?

Yes, with no prop to set. The scene reads the color behind it. On a dark surface the rays and the core add light. On a light one light can't be added, so the rays and the ring are drawn as fine lines in a darker ink of each color, and the core is left as bare paper with the rays leaving its edge. Set the surface with a class on the component, such as bg-slate-950.

How do I keep it clear of my headline?

Set origin to the edge away from the copy: bottom (the default) for copy in the upper half, top for copy at the bottom. length shortens the rays and radius moves the ring. origin="center" puts the core in the middle of the box, where a headline would sit, so use it for a backdrop with nothing on it.

How do I get fewer, thicker rays or a finer burst?

rays is how many long rays leave the core, from 12 to 160; about two and a half times as many finer ones, half as long, fill in between. lineWidth is a ray's thickness at the core in pixels, and it tapers to nothing at the tip. shimmer sets how much each one wavers, and spin how fast they turn, with a negative value for the other way.

What is the ring, and what does a press do?

The ring is a shell around the core: sharp on the outside, soft inside, uneven around its length, with a fainter echo at 1.6 times its radius. ring sets how strongly it shows and radius its size. A press on the background sends another ring out from the core, which fades over about 3 seconds. A press on a link or a button inside it does nothing to the scene.

How do I put it behind the whole page?

Render it empty with className="fixed inset-0 -z-10". It still follows the pointer there, since it listens on the window. To put it behind one section, wrap that section's content in it and give it a height, such as min-h-svh.

Does it work with Next.js and server components?

Yes. Import it into a server component and it renders its box and your content on the server; the canvas starts in the browser and fades in over the surface. It needs WebGL2, which every current browser has. Without it the box keeps its background, or the fallback you pass.

What happens with reduced motion?

It draws one still frame and stops: the full burst with its ring, the same one every time. The pointer no longer moves the origin and a press no longer sends a ring. Touch never moves it in any case, so scrolling on a phone isn't disturbed.

API Reference

Supernova

data-slot="supernova"

PropType
colors?string[]

Two to eight CSS colors, from the core out to the tips of the rays. Theme variables such as var(--primary) follow your theme.

Default
["#fff3e0", "#ffab5e", "#ff5e8a", "#8f5cff"]
core?number

The size and brightness of the point the rays leave from. 0 leaves only the rays.

Default
1
fade?"none" | "radial" | "top" | "bottom" | "left" | "right"

Which edges fade out to the surface: radial keeps the middle, the others name the side that fades.

Type
"none" | "radial" | "top" | "bottom" | "left" | "right"
Default
"none"
fallback?string

What shows until the first frame and in browsers without WebGL2: a CSS background value that looks like the scene.

glow?number

How strongly the soft light around the burst shows, from 0 to 1.

Default
0.5
grain?number

Film grain over the scene, from 0 to 1.

Default
0
intensity?number

How bright the burst is.

Default
1
interactive?boolean

Whether the scene follows the pointer and answers a press. Touch never moves it, so scrolling a page on a phone isn't disturbed.

Default
true
length?number

How far the rays reach, as a multiplier: at 1 the longest cross most of the box.

Default
1
lineWidth?number

The thickness of a ray where it leaves the core, in pixels, from 0.6 to 4. It tapers to nothing at its tip.

Default
1.6
opacity?number

How strongly the scene shows over the surface, from 0 to 1.

Default
1
origin?"bottom" | "center" | "top"

Where the burst sits: on the bottom edge, on the top edge, or in the middle of the box.

Type
"bottom" | "center" | "top"
Default
"bottom"
paused?boolean

Holds the current frame.

Default
false
quality?number

Render scale, from 0.25 to 1, of the screen's pixels (capped at 2×). Lower is cheaper and softer.

Default
1
radius?number

The radius of the shock ring, as a share of the rays' reach, from 0.15 to 0.8.

Default
0.3
rays?number

How many long rays leave the core, from 12 to 160. Finer, shorter ones fill in between them.

Default
56
ring?number

How strongly the shock ring shows. 0 hides it.

Default
1
shimmer?number

How much each ray wavers in brightness and length, from 0 (steady) to 1.

Default
0.6
speed?number

Animation speed: 1 is normal, 0 holds the frame.

Default
1
spin?number

How fast the rays turn about the core, from -3 to 3: negative turns them the other way, 0 holds them still.

Default
1
time?number

A fixed moment, in seconds: draws it and doesn't animate.