Component/Swirl
A bright cell chasing its trail around a square.
Speed1200ms
Opacity100%
import { Swirl } from "loading-dev";
export function SwirlDemo() {
return <Swirl size={48} />;
}Size
Sets the spinner’s dimensions in pixels. The default value is 20
import { Swirl } from "loading-dev";
export default function SwirlSize() {
return (
<div className="flex items-center gap-6">
<Swirl size={16} />
<Swirl size={24} />
<Swirl size={40} />
</div>
);
}Custom Classes
You can use a custom className in case you need to tweak the spinner in a specific way that the library doesn’t provide.
import { Swirl } from "loading-dev";
export default function SwirlClassName() {
return <Swirl className="opacity-40" size={32} />;
}Color
The loader inherits currentColor from the parent by default. You can tint it in any way you want. It accepts any valid CSS color.
import { Swirl } from "loading-dev";
export default function SwirlColor() {
return <Swirl color="#f97316" size={32} />;
}Duration
Sets the speed in ms. Higher values are slower, smaller values are faster.
import { Swirl } from "loading-dev";
export default function SwirlDuration() {
return <Swirl duration={2400} size={32} />;
}State
Pauses or resumes the animation and exposes the state of the spinner.
import { Swirl } from "loading-dev";
export default function SwirlPlayState() {
return <Swirl playState="paused" size={32} />;
}