MCPcopy Create free account
hub / github.com/davidhu2000/react-spinners / sizeProps

Function sizeProps

examples/loaderProps.ts:38–45  ·  view source on GitHub ↗
(name: string, scale: number)

Source from the content-addressed store, hash-verified

36
37/** A loader's size props scaled by `scale`; `sizeProps(name, 1)` are its defaults. */
38export function sizeProps(name: string, scale: number): Record<string, number> {
39 return Object.fromEntries(
40 Object.entries(defaults[name] ?? {}).map(([prop, value]) => [
41 prop,
42 Math.max(1, Math.round(value * scale)),
43 ])
44 );
45}
46
47/** The JSX a user would paste, omitting anything left at its default. */
48export function buildSnippet(name: string, { color, scale, speed }: SpinnerSettings): string {

Callers 2

SpinnerCardFunction · 0.90
buildSnippetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected