MCPcopy
hub / github.com/davidhu2000/react-spinners / SyncLoader

Function SyncLoader

src/SyncLoader.tsx:17–55  ·  view source on GitHub ↗
({
  loading = true,
  color = "#000000",
  speedMultiplier = 1,
  cssOverride = {},
  size = 15,
  margin = 2,
  ...additionalprops
}: LoaderSizeMarginProps)

Source from the content-addressed store, hash-verified

15);
16
17function SyncLoader({
18 loading = true,
19 color = "#000000",
20 speedMultiplier = 1,
21 cssOverride = {},
22 size = 15,
23 margin = 2,
24 ...additionalprops
25}: LoaderSizeMarginProps) {
26 const wrapper: React.CSSProperties = {
27 display: "inherit",
28 ...cssOverride,
29 };
30
31 const style = (i: number): React.CSSProperties => {
32 return {
33 backgroundColor: color,
34 width: cssValue(size),
35 height: cssValue(size),
36 margin: cssValue(margin),
37 borderRadius: "100%",
38 display: "inline-block",
39 animation: `${sync} ${0.6 / speedMultiplier}s ${i * 0.07}s infinite ease-in-out`,
40 animationFillMode: "both",
41 };
42 };
43
44 if (!loading) {
45 return null;
46 }
47
48 return (
49 <span style={wrapper} {...additionalprops}>
50 <span style={style(1)} />
51 <span style={style(2)} />
52 <span style={style(3)} />
53 </span>
54 );
55}
56
57export default SyncLoader;

Callers

nothing calls this directly

Calls 1

styleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…