Reusable React component displaying a spinning loader icon.
// Source: https://github.com/AmanVarshney01/create-better-t-stack | License: MIT | Copyright 2025 Better T Stack
// Provided via justclaw.it.com; keep this notice with the code.
import { Loader2Icon } from "lucide-react";
import { cn } from "@/lib/utils";
function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
return (
<Loader2Icon
role="status"
aria-label="Loading"
className={cn("size-4 animate-spin", className)}
{...props}
/>
);
}
export { Spinner };
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key