Files
Stirling-PDF/frontend/shared/components/Spinner.tsx
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
728 B
TypeScript
Raw Normal View History

2026-06-02 17:08:24 +01:00
import "@shared/components/Spinner.css";
export type SpinnerSize = "xs" | "sm" | "md" | "lg";
export interface SpinnerProps {
size?: SpinnerSize;
/** Optional accessible label for screen readers. */
label?: string;
className?: string;
}
/**
* Circular spinner. Inherits `currentColor` so it picks up the surrounding
* text colour — drop it into a Button, a banner, or a code header without
* any extra styling.
*/
export function Spinner({ size = "md", label, className }: SpinnerProps) {
return (
<span
role="status"
aria-label={label}
aria-busy="true"
className={["sui-spinner", `sui-spinner--${size}`, className ?? ""]
.filter(Boolean)
.join(" ")}
/>
);
}