Menu
Docs menu

DitherAurora

Curtains of light that fold, sway and shimmer, with every knob typed.

Preview

Expanded preview

Installation

Terminal window
pnpm add astro-dither

Or copy the source into your project:

Terminal window
npx astro-dither add aurora

Usage

src/pages/index.astro
---
import { DitherAurora } from "astro-dither";
---
<DitherAurora color="#4ade80" tipColor="#c4b5fd" bloom={0.6} />

The signature look: folding curtains of light. Shape it with curtains, height, spread, sway, turbulence, rays and length; light it with color, tipColor, background, glow, intensity and shimmer; place it with scale, tilt, drift, direction and mask. cell, matrix, levels and bloom set how it is drawn.

Props

PropTypeDefaultDescription
colorstring"#1f8fff"The bright lower edge of each curtain. Hex.
tipColorstringcolorThe faint tops of the rays. Set a second colour for a two-tone sky.
backgroundstring"#02060d"The sky behind. transparent shows the page.
curtainsnumber3How many curtains. Each hangs higher and dimmer.
heightnumber0.42Where the lowest bright edge hangs, 0 to 1.
spreadnumber0.11Vertical gap between curtains.
swaynumber1How far the edges fold.
turbulencenumber0.6Fine ripples along each edge.
raysnumber8How many rays fit across.
lengthnumber0.45How far the rays reach up.
glownumber0.9Brightness of the line along each edge.
intensitynumber0.95Overall curtain brightness.
shimmernumber0.2A slow brightness ripple.
scalenumber1Horizontal zoom.
tiltnumber0Tilt in degrees.
driftnumber0Sideways travel.
direction"up" | "down""up"down hangs the rays from a bright top edge.
mask"none" | "top" | "bottom" | "edges""none"Fades it out where your text sits.
palettestring[]the effect's2 to 8 colours, paper first, brightest last. transparent works.
cellnumber2Size of one dither cell in CSS pixels. Rounded to whole device pixels so cells stay even.
matrix2 | 4 | 8 | "noise"8The Bayer threshold size, or noise for a random look.
speednumber1Playback speed. 0 draws one still frame.
stillTimenumberthe effect'sThe moment drawn when motion is off or reduced, in seconds.
levelsnumber0 (all)Tones the field snaps to before dithering. Low values give hard, posterised steps.
bloomnumber0Bloom around lit cells, 0 to 1. Set a positive prop to create the overlay before overriding it with CSS --dither-bloom.
bloomRadiusnumber10Bloom blur in CSS pixels. CSS --dither-bloom-radius overrides it.
classstringundefinedClasses on the surface element, for size and position.

Notes

  • Decorative surfaces render aria-hidden. Put real text on top, not inside them.
  • With reduced motion it draws one still frame and stops.
  • It pauses when scrolled out of view or when the tab is hidden.