Background

Shooting Stars

Animated meteor shower effects with customizable colors and trajectories. Perfect for React applications requiring dynamic sky animations with Next.js integration and TypeScript support.

Loading component...

Installation

npx shadcn@latest add https://www.shadcn.io/registry/shooting-stars.json
npx shadcn@latest add https://www.shadcn.io/registry/shooting-stars.json
pnpm dlx shadcn@latest add https://www.shadcn.io/registry/shooting-stars.json
bunx shadcn@latest add https://www.shadcn.io/registry/shooting-stars.json

Features

  • Customizable star colors with hex color values for personalized visual themes
  • Variable speed control configuring minimum and maximum ranges for natural movement patterns
  • Adjustable timing intervals controlling delay between star appearances for different effects
  • Multi-directional trajectories with stars appearing from random screen edges
  • Scalable depth animation where stars grow larger as they travel for realistic perception
  • Performance optimized using efficient SVG rendering with requestAnimationFrame
  • Layerable effects supporting multiple instances for complex multi-color combinations
  • TypeScript support with complete interface definitions for reliable integration

Examples

Multi-Color Effect

Loading component...

Use Cases

This free open source React component works well for:

  • Hero sections - Dynamic sky effects for space-themed landing pages built with Next.js
  • Gaming interfaces - Atmospheric backgrounds for space games and sci-fi applications using TypeScript
  • Portfolio headers - Eye-catching animations showcasing creative capabilities
  • Event websites - Dramatic backgrounds for conferences and product launches using shadcn/ui design
  • Loading screens - Engaging animations during content loading and data processing
  • Creative showcases - Artistic backgrounds for design portfolios using Tailwind CSS animations

API Reference

ShootingStars

PropTypeDefaultDescription
starColorstring"#9E00FF"Color of the shooting stars (hex format)
trailColorstring"#2EB9DF"Color of the star trails (hex format)
minSpeednumber10Minimum speed of star movement
maxSpeednumber30Maximum speed of star movement
minDelaynumber1200Minimum delay between star appearances (ms)
maxDelaynumber4200Maximum delay between star appearances (ms)
starWidthnumber10Width of the star trail
starHeightnumber1Height of the star trail
classNamestringundefinedAdditional CSS classes for the container

Implementation Notes

  • Component uses SVG-based rendering with requestAnimationFrame for smooth animations
  • Stars appear from random screen edges with realistic diagonal trajectories
  • Each star grows in size as it travels, creating natural depth perception effects
  • Multiple instances can be layered with different colors and timing for complex effects
  • Performance optimized using efficient DOM manipulation and memory management
  • Compatible with shadcn/ui design system and responsive across all device sizes
  • Animation timing randomized between minDelay and maxDelay for natural appearance
  • Star colors customizable via hex values to match any design system or brand palette