Meteors
A beautiful meteor shower effect that creates falling streaks across your interface. Perfect for adding dynamic background animation to hero sections.Installation
CSS Variables
Add the following to your global CSS file:src/routes/+layout.css
Usage
Props
The number of meteors to display.
The minimum animation delay in seconds before a meteor starts falling.
The maximum animation delay in seconds before a meteor starts falling.
The minimum duration of a meteor’s fall animation in seconds.
The maximum duration of a meteor’s fall animation in seconds.
The angle of the meteor’s trajectory in degrees. Default creates a diagonal fall from top-right to bottom-left.
Additional CSS classes to apply to each meteor element.
Examples
Basic Meteor Shower
Dense Meteor Shower
Slower Meteors
Different Angle
Custom Color
Quick Meteors
Sparse Shower
Notes
- Each meteor has a randomized starting position, delay, and duration
- Meteors are created with a small circular head and a tail gradient
- Animation runs infinitely, creating a continuous shower effect
- Uses CSS transforms for smooth performance
- Meteors start from -5% above the container for smooth entrance
- The tail is created using a linear gradient
- Default angle of 215° creates a natural diagonal fall
- Best used with dark backgrounds for maximum visibility
- Meteors are pointer-events-none to avoid interfering with content