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

Function PuffLoader

src/PuffLoader.tsx:14–60  ·  view source on GitHub ↗
({
  loading = true,
  color = "#000000",
  speedMultiplier = 1,
  cssOverride = {},
  size = 60,
  ...additionalprops
}: LoaderSizeProps)

Source from the content-addressed store, hash-verified

12];
13
14function PuffLoader({
15 loading = true,
16 color = "#000000",
17 speedMultiplier = 1,
18 cssOverride = {},
19 size = 60,
20 ...additionalprops
21}: LoaderSizeProps) {
22 const wrapper: React.CSSProperties = {
23 display: "inherit",
24 position: "relative",
25 width: cssValue(size),
26 height: cssValue(size),
27 ...cssOverride,
28 };
29
30 const style = (i: number): React.CSSProperties => {
31 return {
32 position: "absolute",
33 height: cssValue(size),
34 width: cssValue(size),
35 border: `thick solid ${color}`,
36 borderRadius: "50%",
37 opacity: "1",
38 top: "0",
39 left: "0",
40 animationFillMode: "both",
41 animation: `${puff[0]}, ${puff[1]}`,
42 animationDuration: `${2 / speedMultiplier}s`,
43 animationIterationCount: "infinite",
44 animationTimingFunction:
45 "cubic-bezier(0.165, 0.84, 0.44, 1), cubic-bezier(0.3, 0.61, 0.355, 1)",
46 animationDelay: i === 1 ? "-1s" : "0s",
47 };
48 };
49
50 if (!loading) {
51 return null;
52 }
53
54 return (
55 <span style={wrapper} {...additionalprops}>
56 <span style={style(1)} />
57 <span style={style(2)} />
58 </span>
59 );
60}
61
62export default PuffLoader;

Callers

nothing calls this directly

Calls 2

cssValueFunction · 0.90
styleFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…