ZUI

Search documentation

Find a page or a heading.

Meteors

A decorative background of meteors falling across their container, each a dot trailing a fading line, drawn in the text colour and hidden under reduced motion.

tsx

Installation

bash

Usage

tsx

The meteors fill their nearest positioned ancestor, so place them in a relative box that clips its overflow, and lift the content over them with relative:

tsx

They are decoration: hidden from assistive technology and from the pointer, so nothing they cover stops taking clicks. A text-* class recolours them.

API reference

Meteors

Renders a div and takes every prop a div takes, plus:

Each meteor starts at a random point along the top edge and first falls after a random wait between minDelay and maxDelay seconds, then falls again every minDuration to maxDuration seconds, a whole number picked once per meteor. angle is the path's rotation in degrees, as CSS rotate measures it; at 215 a meteor falls to the right and down. The points are picked after the component mounts, so a server render draws no meteor. Under prefers-reduced-motion no meteor is drawn. It sets data-slot="meteors" and aria-hidden.