A shower of meteors streaking across the parent container. Pure CSS — positions, delays and durations are generated server-side, so the effect costs zero JavaScript.
Place it inside any relative container (a hero section, a card) and it
fills the space behind your content.
Summary
Functions
Renders a meteor shower that fills its nearest relative ancestor.
Functions
Renders a meteor shower that fills its nearest relative ancestor.
<div class="relative overflow-hidden rounded-xl bg-gray-950 p-12">
<.meteors count={30} />
<.h2 class="relative text-white">Ship faster with Petal</.h2>
</div>Meteor positions are deterministic for a given seed, so LiveView
re-renders never make the meteors jump.
Attributes
count(:integer) - number of meteors. Defaults to20.seed(:integer) - vary this when rendering several meteor fields on one page so each gets a different scatter pattern. Defaults to0.class(:any) - extra classes for the container. Defaults tonil.- Global attributes are accepted.