Skip to documentation content

Meteors

Rain thin diagonal streaks of light across a card or section background.

meteors-demo

Overview

Meteors draws thin streaks that fall diagonally across their parent at staggered times and speeds. Use it sparingly behind a hero, a changelog entry, or a launch card. Positions come from a seeded generator, so the server and client render the same layout and there is no hydration mismatch; change seed for a different arrangement.

Installation

npx honestui@latest add meteors

Usage

import { Meteors } from "@/components/animated/meteors"

<div className="relative overflow-hidden rounded-xl border p-6">
  <Meteors number={16} />
  <h3 className="relative">Faster cold starts</h3>
</div>

Meteors fills and clips to its nearest positioned ancestor. Give foreground content relative so it stacks above the streaks.

Accessibility

The streaks are decorative and hidden from assistive technology. Keep text contrast high where streaks cross it. When reduced motion is requested, the streaks are not shown at all.

API Reference

PropTypeDefaultDescription
numbernumber14Number of streaks.
anglenumber215Direction of travel in degrees.
minDelaynumber0.2Shortest delay before a streak first appears, in seconds.
maxDelaynumber6Longest delay before a streak first appears, in seconds.
minDurationnumber3Shortest fall, in seconds.
maxDurationnumber8Longest fall, in seconds.
tailLengthnumber64Tail length in px.
seednumber7Seed for the layout. The same seed always gives the same streaks.
classNamestring–Classes for the meteor layer.