Skip to content

Meteors Effect for React

Meteors is a React effect that sends occasional streaks of light across a card or section background. Use it for quiet depth; each streak moves by transform and opacity only and stays still under reduced motion.

npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/meteors.json
Launch week

Ship the quiet details

A streak crosses now and then, never twice at once.

On a glass card

Meteors fills its relative parent, takes the parent's corner radius and clips to it. Put it before the content so the text sits above the streaks, and keep count low: a long interval is what keeps it occasional.

Launch week

Ship the quiet details

A streak crosses now and then, never twice at once.

Files to copy

5 folders · 7 files · 4 packages
From theme/src/
  • components/meteors/
  • lib/{canvas-effects.ts, cn.ts}
  • hooks/{use-media-query.ts, use-preferences.ts}
  • motion/{beat-animations.ts, beat.ts, gate.ts}
  • styles/
shadcn CLI
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/meteors.jsonRegistry item: meteors. The styles need the Tailwind v4 glass UI setup.
The examples also use
  • components/badge/
  • components/glass-card/
  • components/switch/
  • hooks/{use-direction.ts, use-latest.ts}
  • motion/{light-follower.ts, tokens.ts}
  • lib/{field-control-shell.tsx, form.ts, heading.ts, motion-props.ts, state-light.tsx, warn-once.ts}
npx shadcn@latest add https://lokendra-builds.github.io/sheenui/r/badge.json https://lokendra-builds.github.io/sheenui/r/glass-card.json https://lokendra-builds.github.io/sheenui/r/switch.json
Packages
pnpm add @base-ui/react clsx motion tailwind-merge

Angle, length and rhythm

angle is the direction of travel in degrees clockwise from pointing right (90 is straight down). A shorter interval and more meteors make a shower; keep that for a one-off hero.

A faster shower at 70 degrees.

Props

PropTypeDefaultDescription
countnumber12How many meteors share the field. Each one flies, then rests for a few seconds, so only a couple are ever in view at once. Capped at 24.
anglenumber125Direction of travel in degrees, clockwise from pointing right: 90 flies straight down, 125 down and to the left, 45 down and to the right.
lengthnumber140Length of a streak in px; each one varies a little around it.
durationnumber1.6Seconds one flight takes, on average.
intervalnumber3.2Seconds a meteor rests between flights, on average; this is what keeps them occasional.
colorstring"var(--sheen-accent-2)"Colour of the bright head, any CSS colour.
pausedbooleanfalseHold every streak where it is (they carry on from there when unpaused).
seednumber3Seed for the layout and timing, so the same card looks the same on the server and in the browser.
classNamestringNoneAdds extra classes to the overlay. It fills its relative parent and takes the parent's corner radius.
styleCSSPropertiesNoneApplies an inline style to the overlay.

Keyboard

KeysAction
TabNot focusable: the layer is click-through and never takes focus.

Accessibility

  • Decorative: the layer is aria-hidden. Streaks are thin and fade quickly; use paused where a card sits next to long text (WCAG 2.2.2).
  • Reduced motion: nothing flies. Up to four faint still streaks stay as texture.
  • Each streak is one element moved by transform and faded by opacity on the compositor, with no blur, mask or filter. They pause off-screen and in hidden tabs.
  • The layout is seeded (seed), so the server and the browser render the same streaks and there is no hydration mismatch or layout shift.

When to use the meteors effect

  • Use it on a feature card or a section background to add a quiet sense of space, with a streak crossing now and then.
  • Tune count, interval and angle: a long interval keeps it occasional, which is what makes it feel premium rather than busy.
  • Put it behind glass content so the glass blurs the streaks, or above flat content; it clips to the parent's corner radius.
  • Skip it on cards with a lot of text, or use paused; moving light near reading is distracting.
  • Pair it with GlassCard, BorderBeam on the same card for a stronger moment, and Badge for a launch label.

Frequently asked questions

19 effects pages in all: browse them on All effects.

By Lokendra Singh Rathore (GitHub, opens in a new tab). Published , updated .