CoolFace
Apppublic

Leon4gr45/builder

sourceHugging Facemitupdated 2d agoView on Hugging Face
0likes
spinner.tsx35 linesDownload Raw Back to ui
1import { cn } from '@/lib/utils';2 3interface SpinnerProps {4  className?: string;5  size?: number;6  color?: string;7}8 9export function Spinner({ className, size = 48, color }: SpinnerProps) {10  const r = 18; // radius11  const circumference = 2 * Math.PI * r;12  const arcLength = circumference * 0.7; // 70% arc13 14  return (15    <svg16      className={cn('animate-spin', className)}17      width={size}18      height={size}19      viewBox="0 0 44 44"20      fill="none"21      xmlns="http://www.w3.org/2000/svg"22    >23      <circle24        cx="22"25        cy="22"26        r={r}27        stroke={color || 'currentColor'}28        strokeWidth="3"29        strokeLinecap="round"30        strokeDasharray={`${arcLength} ${circumference - arcLength}`}31      />32    </svg>33  );34}35