Installation
Usage
import { CometSpinner } from "@/components/loading-ui/comet-spinner";<CometSpinner />Customization
CometSpinner is built from layered box-shadow motion plus rotation, wrapped in a container query box so orbit math scales with size-*. Color comes from currentColor, and timing is driven by --duration.
Size
The spinner is aspect-square; grow or shrink it with size-* depending on the density of the surrounding layout.
Color
Set hue with text utilities—the head and tail inherit through the foreground color.
Duration
Set --duration with a CSS time value. The same value paces both the tail morph and the rotation.
Geometry
headScale and radiusScale are clamped helpers that reshape the comet: smaller heads feel sharper, larger radii widen the sweep.
Examples
These examples lean into burst, upload, and fast-lane stories where the motion should feel directional.
Button
Compact size-* on the icon slot keeps the comet legible beside label text.
Badge
In chips, a smaller comet still reads as motion without stealing focus from the label.
Alert
Pair the comet with a strong headline when the event is positive or neutral but still in flight.
Tabs
Use tabs when only one surface is “burning hot” while the rest of the page stays cool and interactive.
Throughput is spiking while the tail catches up to the head— other tabs stay usable.