Skip to content

Commit

Permalink
Make stroke color configurable for spinner
Browse files Browse the repository at this point in the history
Optional, defaults to "currentcolor".
  • Loading branch information
Arnei committed May 28, 2024
1 parent e876eb8 commit 0f22128
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/spinner.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import { keyframes } from "@emotion/react";
import React from "react";
import { useAppkitConfig } from ".";


type Props = JSX.IntrinsicElements["svg"] & {
size?: number | string;
strokeColor?: string,
};

export const Spinner = React.forwardRef<SVGSVGElement, Props>(({ size = "1em", ...rest }, ref) => {
const config = useAppkitConfig();

export const Spinner = React.forwardRef<SVGSVGElement, Props>(({
size = "1em",
strokeColor = "currentcolor",
...rest
}, ref) => {
return (
<svg
ref={ref}
Expand All @@ -23,7 +24,7 @@ export const Spinner = React.forwardRef<SVGSVGElement, Props>(({ size = "1em", .
})}`,
"& > circle": {
fill: "none",
stroke: config.colors.neutral90,
stroke: strokeColor,
strokeWidth: 4,
strokeDasharray: 83, // 2/3 of circumference
strokeLinecap: "round",
Expand Down

0 comments on commit 0f22128

Please sign in to comment.