Skip to content

Commit 5a2f655

Browse files
fix(spinner): add configurable aria-label
- Updated `Spinner` component to accept an optional `ariaLabel` prop. - Sets default `aria-label` to "Loading". - Ensures accessibility for screen readers by allowing context-specific labels.
1 parent 0c3f602 commit 5a2f655

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

web/components/ui/Spinner.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@ import { Loader2 } from 'lucide-react';
44
interface SpinnerProps {
55
className?: string;
66
size?: number;
7+
ariaLabel?: string;
78
}
89

9-
export const Spinner: React.FC<SpinnerProps> = ({ className = '', size = 18 }) => {
10+
export const Spinner: React.FC<SpinnerProps> = ({ className = '', size = 18, ariaLabel = "Loading" }) => {
1011
return (
1112
<Loader2
1213
className={`animate-spin ${className}`}
1314
size={size}
14-
aria-label="Loading"
15+
aria-label={ariaLabel}
1516
/>
1617
);
1718
};

0 commit comments

Comments
 (0)