Skip to content

Commit 44a8401

Browse files
committed
Add load spinner component
1 parent cf73e05 commit 44a8401

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { cn } from "@/lib/utils";
2+
3+
/**
4+
* Copyright (c) 2024
5+
* Original component by onurhan1337
6+
* Source: https://github.com/shadcn-ui/ui/discussions/1694
7+
*/
8+
export interface ISVGProps extends React.SVGProps<SVGSVGElement> {
9+
size?: number;
10+
className?: string;
11+
}
12+
13+
export const LoadingSpinner = ({
14+
size = 24,
15+
className,
16+
...props
17+
}: ISVGProps) => {
18+
return (
19+
<svg
20+
xmlns="http://www.w3.org/2000/svg"
21+
width={size}
22+
height={size}
23+
{...props}
24+
viewBox="0 0 24 24"
25+
fill="none"
26+
stroke="currentColor"
27+
strokeWidth="2"
28+
strokeLinecap="round"
29+
strokeLinejoin="round"
30+
className={cn("animate-spin", className)}
31+
>
32+
<path d="M21 12a9 9 0 1 1-6.219-8.56" />
33+
</svg>
34+
);
35+
};

0 commit comments

Comments
 (0)