├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ └── feature_request.md
├── PULL_REQUEST_TEMPLATE.md
├── actions
│ └── setup-node
│ │ └── action.yaml
├── dependabot.yml
└── workflows
│ └── deploy.yml
├── .gitignore
├── .npmignore
├── .prettierignore
├── .prettierrc.cjs
├── .storybook
├── canonical-link
│ └── register.js
├── google-analytics-v4
│ └── register.js
├── main.js
├── manager.js
└── preview.js
├── .vscode
└── settings.json
├── .yarn
└── releases
│ └── yarn-4.9.1.cjs
├── .yarnrc.yml
├── CHANGELOG.md
├── CODEOWNERS
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── eslint.config.mjs
├── examples
├── components
│ ├── Code.tsx
│ ├── ColorPicker.tsx
│ ├── LoaderItem.tsx
│ └── index.ts
├── index.html
├── index.tsx
└── styles.css
├── jest.config.js
├── package.json
├── scripts
├── build-docs.sh
├── mod.rb
├── stories.rb
└── stories.template
├── src
├── BarLoader.tsx
├── BeatLoader.tsx
├── BounceLoader.tsx
├── CircleLoader.tsx
├── ClimbingBoxLoader.tsx
├── ClipLoader.tsx
├── ClockLoader.tsx
├── DotLoader.tsx
├── FadeLoader.tsx
├── GridLoader.tsx
├── HashLoader.tsx
├── MoonLoader.tsx
├── PacmanLoader.tsx
├── PropagateLoader.tsx
├── PuffLoader.tsx
├── PulseLoader.tsx
├── RingLoader.tsx
├── RiseLoader.tsx
├── RotateLoader.tsx
├── ScaleLoader.tsx
├── SkewLoader.tsx
├── SquareLoader.tsx
├── SyncLoader.tsx
├── helpers
│ ├── animation.server.test.ts
│ ├── animation.test.ts
│ ├── animation.ts
│ ├── colors.test.ts
│ ├── colors.ts
│ ├── props.ts
│ ├── unitConverter.test.ts
│ └── unitConverter.ts
└── index.ts
├── stories
└── .keep
├── test-apps
└── nextjs
│ ├── .gitignore
│ ├── next.config.ts
│ ├── package.json
│ ├── src
│ └── app
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── tsconfig.json
│ └── yarn.lock
├── tests
└── AllLoaders.test.tsx
├── tsconfig.cjs.json
├── tsconfig.esm.json
├── tsconfig.json
├── vite.config.mjs
└── yarn.lock
/.github/ISSUE_TEMPLATE/bug_report.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Bug report
3 | about: Create a report to help us improve
4 | title: ""
5 | labels: ""
6 | assignees: ""
7 | ---
8 |
9 | **Package Version**
10 |
11 |
12 |
13 | **Describe the bug**
14 |
15 |
16 | **To Reproduce**
17 |
18 |
19 | **Expected behavior**
20 |
21 |
22 |
23 | **Screenshots**
24 |
25 |
26 |
27 | **Additional context**
28 |
29 |
30 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.md:
--------------------------------------------------------------------------------
1 | ---
2 | name: Feature request
3 | about: Suggest an idea for this project
4 | title: ""
5 | labels: ""
6 | assignees: ""
7 | ---
8 |
9 | **Is your feature request related to a problem? Please describe.**
10 |
11 |
12 |
13 | **Describe the solution you'd like**
14 |
15 |
16 |
17 | **Describe alternatives you've considered**
18 |
19 |
20 |
21 | **Additional context**
22 |
23 |
24 |
--------------------------------------------------------------------------------
/.github/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | # What changes are introduced?
2 |
3 | # Any screenshots?
4 |
--------------------------------------------------------------------------------
/.github/actions/setup-node/action.yaml:
--------------------------------------------------------------------------------
1 | name: setup-node-env
2 |
3 | runs:
4 | using: "composite"
5 | steps:
6 | - uses: actions/setup-node@v4
7 | with:
8 | node-version: 20.x
9 | - run: npm install --global yarn
10 | shell: bash
11 | - uses: actions/setup-node@v4
12 | with:
13 | node-version: 20.x
14 | cache: "yarn"
15 | - run: yarn install
16 | shell: bash
17 |
--------------------------------------------------------------------------------
/.github/dependabot.yml:
--------------------------------------------------------------------------------
1 | # To get started with Dependabot version updates, you'll need to specify which
2 | # package ecosystems to update and where the package manifests are located.
3 | # Please see the documentation for all configuration options:
4 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5 |
6 | version: 2
7 | updates:
8 | - package-ecosystem: "github-actions"
9 | directory: "/"
10 | schedule:
11 | interval: "daily"
12 | - package-ecosystem: "github-actions"
13 | directory: "/.github/actions/setup-node"
14 | schedule:
15 | interval: "daily"
16 | - package-ecosystem: "npm"
17 | directory: "/"
18 | schedule:
19 | interval: "daily"
20 | groups:
21 | storybook:
22 | patterns: ["@storybook/*", "storybook"]
23 | testing:
24 | patterns: ["@testing-library/*", "jest*", "ts-jest"]
25 | eslint:
26 | patterns: ["eslint*", "@typescript-eslint/*"]
27 | react:
28 | patterns: ["react", "react-dom", "@types/react", "@types/react-dom"]
29 |
--------------------------------------------------------------------------------
/.github/workflows/deploy.yml:
--------------------------------------------------------------------------------
1 | name: deploy
2 |
3 | on:
4 | push:
5 | branches: [main]
6 | pull_request:
7 | branches: [main]
8 |
9 | permissions:
10 | contents: read
11 | pages: write
12 | id-token: write
13 |
14 | jobs:
15 | tests:
16 | runs-on: ubuntu-latest
17 | steps:
18 | - uses: actions/checkout@v4
19 | - uses: ./.github/actions/setup-node
20 | - run: yarn run clean
21 | - run: yarn run test
22 | - name: Coveralls
23 | uses: coverallsapp/github-action@master
24 | with:
25 | github-token: ${{ secrets.GITHUB_TOKEN }}
26 | lint:
27 | runs-on: ubuntu-latest
28 |
29 | steps:
30 | - uses: actions/checkout@v4
31 | - uses: ./.github/actions/setup-node
32 | - run: yarn run clean
33 | - run: yarn run lint --max-warnings=0
34 |
35 | build-site:
36 | runs-on: ubuntu-latest
37 |
38 | steps:
39 | - uses: actions/checkout@v4
40 | - uses: ruby/setup-ruby@v1
41 | with:
42 | ruby-version: "3.0"
43 | - uses: ./.github/actions/setup-node
44 | - name: Build demo site
45 | run: yarn run build:demo
46 | - name: Create stories
47 | run: ruby scripts/stories.rb
48 | - name: Build storybook
49 | run: yarn run build-storybook
50 |
51 | - name: Upload Pages Artifact
52 | if: ${{ github.event_name != 'pull_request' }}
53 | uses: actions/upload-pages-artifact@v3
54 | with:
55 | path: "./dist"
56 |
57 | deploy-site:
58 | if: ${{ github.event_name != 'pull_request' }}
59 | needs: [build-site, lint, tests]
60 | runs-on: ubuntu-latest
61 | environment:
62 | name: github-pages
63 | url: ${{ steps.deployment.outputs.page_url }}
64 | steps:
65 | - name: Deploy to GitHub Pages
66 | id: deployment
67 | uses: actions/deploy-pages@v4
68 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *~
3 | *.iml
4 | .*.haste_cache.*
5 | .DS_Store
6 | .idea
7 | npm-debug.log
8 | node_modules
9 | dist
10 | docs/javascripts
11 | docs/js
12 | docs/index.html
13 | docs/storybook
14 | coverage
15 | cjs
16 | esm
17 | umd
18 | .yarn/cache
19 | .yarn/install-state.gz
20 | stories/*.tsx
21 | storybook-static
22 | coverage
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | *~
3 | *.iml
4 | .*.haste_cache.*
5 | .DS_Store
6 | .idea
7 | .babelrc
8 | .eslintrc
9 | npm-debug.log
10 | lib
11 |
12 | .yarn/*
13 | .yarnrc
14 | examples
15 | docs
16 | webpack.config.*
17 | prettier.config.*
18 | template.html
19 | .github
20 | .circleci
21 | .eslintrc.*
22 | coverage
23 | src
24 | tslint.json
25 | jest.config.*
26 | CODEOWNERS
27 | CODE_OF_CONDUCT.md
28 | CONTRIBUTING.md
29 | stories
30 | yarn-error.log
31 | .storybook
32 | .prettierignore
33 | test-apps
34 | tests
35 | CHANGELOG.md
36 | .yarnrc.yml
37 | .prettierrc.cjs
38 | tests/*
39 | scripts/*
40 | .vscode/*
41 | eslint.config.mjs
--------------------------------------------------------------------------------
/.prettierignore:
--------------------------------------------------------------------------------
1 | .yarn
2 | node_modules
3 | yarn.lock
4 | coverage
5 | docs/storybook
6 | docs/javascripts
7 | docs/js
8 | template.html
9 |
--------------------------------------------------------------------------------
/.prettierrc.cjs:
--------------------------------------------------------------------------------
1 | /** @type {import("prettier").Options} */
2 | module.exports = {
3 | printWidth: 100,
4 | tabWidth: 2,
5 | trailingComma: "es5",
6 | singleQuote: false,
7 | semi: true,
8 | pluginSearchDirs: false,
9 | };
10 |
--------------------------------------------------------------------------------
/.storybook/canonical-link/register.js:
--------------------------------------------------------------------------------
1 | import { addons } from "@storybook/addons";
2 |
3 | addons.register("storybook/canonical-link", (api) => {
4 | var link = document.createElement("link");
5 | link.setAttribute("rel", "canonical");
6 | link.setAttribute("href", "https://www.davidhu.io/react-spinners/storybook");
7 | document.head.appendChild(link);
8 | });
9 |
--------------------------------------------------------------------------------
/.storybook/google-analytics-v4/register.js:
--------------------------------------------------------------------------------
1 | import { addons } from "@storybook/addons";
2 | import { STORY_CHANGED, STORY_ERRORED, STORY_MISSING } from "@storybook/core-events";
3 | import ReactGa from "react-ga4";
4 |
5 | addons.register("storybook/google-analytics-v4", (api) => {
6 | ReactGa.initialize(window.STORYBOOK_GA_V4_ID, window.STORYBOOK_REACT_GA_OPTIONS);
7 |
8 | api.on(STORY_CHANGED, () => {
9 | const { path } = api.getUrlState();
10 | ReactGa.send({ hitType: "pageview", page: path });
11 | });
12 | api.on(STORY_ERRORED, ({ description }) => {
13 | ReactGa.exception({
14 | description,
15 | fatal: true,
16 | });
17 | });
18 | api.on(STORY_MISSING, (id) => {
19 | ReactGa.exception({
20 | description: `attempted to render ${id}, but it is missing`,
21 | fatal: false,
22 | });
23 | });
24 | });
25 |
--------------------------------------------------------------------------------
/.storybook/main.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | stories: ["../stories/*.stories.@(ts|tsx)"],
3 |
4 | addons: [
5 | "@storybook/addon-links",
6 | "@storybook/addon-essentials",
7 | "@storybook/addon-interactions",
8 | "storybook-dark-mode",
9 | "./google-analytics-v4/register.js",
10 | "./canonical-link/register.js",
11 | "@storybook/addon-webpack5-compiler-swc",
12 | ],
13 |
14 | framework: {
15 | name: "@storybook/react-vite",
16 | options: {},
17 | },
18 |
19 | core: {
20 | disableTelemetry: true,
21 | },
22 |
23 | docs: {},
24 |
25 | typescript: {
26 | reactDocgen: "react-docgen-typescript",
27 | },
28 | };
29 |
--------------------------------------------------------------------------------
/.storybook/manager.js:
--------------------------------------------------------------------------------
1 | window.STORYBOOK_GA_ID = "UA-92266369-2";
2 | window.STORYBOOK_GA_V4_ID = "G-ZLGVJTEW5V";
3 | window.STORYBOOK_REACT_GA_OPTIONS = {};
4 |
--------------------------------------------------------------------------------
/.storybook/preview.js:
--------------------------------------------------------------------------------
1 | export const parameters = {
2 | controls: {
3 | matchers: {
4 | color: /(background|color)$/i,
5 | date: /Date$/,
6 | },
7 | },
8 | layout: "centered",
9 | };
10 |
11 | export const argTypes = {
12 | color: {
13 | description: "Hex code of load colors",
14 | control: { type: "color" },
15 | defaultValue: "#36d7b7",
16 | },
17 | loading: {
18 | description: "controls whether loader is shown",
19 | control: { type: "boolean" },
20 | },
21 | speedMultiplier: {
22 | description: "controls the speed of animation. Higher number equals faster speed",
23 | control: { type: "number" },
24 | },
25 | cssOverride: {
26 | description: "override default styles. Needs to be camelCase keys",
27 | control: { type: "object" },
28 | },
29 | };
30 | export const tags = ["autodocs"];
31 |
--------------------------------------------------------------------------------
/.vscode/settings.json:
--------------------------------------------------------------------------------
1 | {
2 | "editor.defaultFormatter": "esbenp.prettier-vscode",
3 | "[ruby]": {
4 | "editor.defaultFormatter": "mbessey.vscode-rufo"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/.yarnrc.yml:
--------------------------------------------------------------------------------
1 | compressionLevel: mixed
2 |
3 | enableGlobalCache: false
4 |
5 | nodeLinker: node-modules
6 |
7 | yarnPath: .yarn/releases/yarn-4.9.1.cjs
8 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | > [!IMPORTANT]
2 | > This changelog is deprecated. Please check [GitHub Releases](https://github.com/davidhu2000/react-spinners/releases) for the most up-to-date release information.
3 |
4 | # Change Log
5 |
6 | All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).
7 |
8 | ## 0.14.1
9 |
10 | - revert [#602](https://github.com/davidhu2000/react-spinners/pull/602) due to issues with test and server side rendering
11 |
12 | ## 0.14.0
13 |
14 | - feat: color prop can accept rgb colors [#586](https://github.com/davidhu2000/react-spinners/pull/586)
15 | - fix: multiple hash loader with different color renders as the same color [#602](https://github.com/davidhu2000/react-spinners/pull/602)
16 | - fix: moon loader wobble if size is not divisible by 7 [#603](https://github.com/davidhu2000/react-spinners/pull/603)
17 |
18 | ## 0.13.8
19 |
20 | - **bugfix**: Remove Animation Fill Mode from CircleLoader to fix SSR mismatch style error. [#558](https://github.com/davidhu2000/react-spinners/pull/558)
21 |
22 | ## 0.13.7
23 |
24 | - **bugfix**: fix PacmanLoader container height/width to adjust with size prop
25 |
26 | ## 0.13.6
27 |
28 | - Improve formatting of example code to include `data-testid` prop
29 |
30 | ## 0.13.5
31 |
32 | - Improve README to include additional available props via span tag
33 |
34 | ## 0.13.4
35 |
36 | - **bugfix**: fix server side render issue on `HashLoader`
37 |
38 | ## 0.13.3
39 |
40 | - **bugfix**: Fix PuffLoader initial rendering issue
41 |
42 | ## 0.13.2
43 |
44 | - remove next version badge until needed
45 |
46 | ## 0.13.1
47 |
48 | - update homepage in package.json
49 |
50 | ## 0.13.0
51 |
52 | - Rewrite each loader from the ground up using functional components.
53 | - Replaced `@emotion` with vanilla javascript and inline style to reduce component size by 75%. This project now have 0 dependencies, while continuing to support server side rendering.
54 | - Added support for custom props such as `aria-label`
55 | - renamed `css` prop to `cssOverride` to avoid type conflicts with css-in-js libraries.
56 |
57 | ## 0.13.0-beta.7
58 |
59 | - **bugfix**: fix style warnings on ClipLoader and CircleLoader
60 |
61 | ## 0.13.0-beta.6
62 |
63 | - **bugfix**: fix GridLoader rendering issue
64 |
65 | ## 0.13.0-beta.5
66 |
67 | - **BREAKING CHANGE**: `css` prop has been renamed to `cssOverride` to avoid type conflicts with css-in-js libraries such as emotion and styled-components
68 |
69 | ## 0.13.0-beta.4
70 |
71 | - **bugfix**: Fix `document is not defined` when rendering server side
72 |
73 | ## 0.13.0-beta.3
74 |
75 | - update `.npmignore` to ignore `stories` folder, yarn error log
76 |
77 | ## 0.13.0-beta.2
78 |
79 | - **bugfix**: Update `tsconfig.json` to ignore `stories` folder. This caused the outputted files to not be in the root directory and breaking the imports.
80 |
81 | ## 0.13.0-beta.1
82 |
83 | - **bugfix**: Properly assign important tag to `GridLoader` width prop.
84 |
85 | ## 0.13.0-alpha.5
86 |
87 | - **bugfix**: Update `GridLoader` height/width with `important` tag to prevent overwrites from outside css.
88 |
89 | ## 0.13.0-alpha.4
90 |
91 | - **Feature**: Add support for custom props in all loaders.
92 | - **Feature**: Removed `@emotion/react` as a dependency.
93 | - **Feature**: Update `RiseLoader` rise amount of use `size` prop instead of hardcoded as 30px.
94 |
95 | ## 0.13.0-alpha.3
96 |
97 | - **Feature**: Add support for custom props in BarLoader
98 |
99 | ## 0.13.0-alpha.2
100 |
101 | - Added react testing library
102 | - added basic tests for BarLoader
103 | - **bugfix**: add `display: inherit` on barloader to fix issue where nothing shows up on page.
104 |
105 | ## 0.13.0-alpha.1
106 |
107 | - Rewrite BarLoader as functional component. Use vanilla javascript to inject keyframes, and removing emotion from the component.
108 |
109 | ## 0.12.0
110 |
111 | - **Feature**: output commonjs, es module, and umd file types.
112 | - **Feature**: add support for react 18 [#464](https://github.com/davidhu2000/react-spinners/pull/464)
113 |
114 | ## 0.12.0-beta.1
115 |
116 | - reverted devDepencies react back to v17 until tests can be migrated away from enzyme. [#471](https://github.com/davidhu2000/react-spinners/pull/471)
117 |
118 | ## 0.12.0-alpha.3
119 |
120 | - migrate from circle-ci to github actions for lint/jest
121 | - **Feature**: add support for react 18 [#464](https://github.com/davidhu2000/react-spinners/pull/464)
122 |
123 | ## 0.12.0-alpha.2
124 |
125 | - Update pragma to `/** @jsxImportSource @emotion/react */` to fix issue with the new jsx runtime.
126 | - update all dependencies to latest version and rebuild demo site
127 |
128 | ## 0.12.0-alpha.1
129 |
130 | - **Feature**: output commonjs, es module, and umd file types.
131 |
132 | ## 0.11.0
133 |
134 | - **Feature**: added `speedMultiplier` prop to allow controlling the speed of animations.
135 |
136 | ## 0.11.0-beta.1
137 |
138 | - No changes, just promoting to beta
139 |
140 | ## 0.11.0-alpha.8
141 |
142 | - Update readme to include speed multiplier prop
143 |
144 | ## 0.11.0-alpha.7
145 |
146 | - Implemented `speedMultiplier` props to all loaders
147 | - Added feature flag to demo site. adding a url param `speed-multiplier=true` will enable to input
148 |
149 | ## 0.11.0-alpha.6
150 |
151 | - Refactored all the tests using shared specs to reduce maintenance cost.
152 | - Removed unnecessary type in `colors.ts` to let typescript infer.
153 |
154 | ## 0.11.0-alpha.5
155 |
156 | - Implement `speedMultipler` prop to `PulseLoader`. This is done to test the API for a single loader before adding to the rest.
157 |
158 | ## 0.11.0-alpha.4
159 |
160 | - Clean up `BarLoader` by marking the props using `Required` utility to avoid having to do `width || Loader.defaultProps.width`.
161 |
162 | ## 0.11.0-alpha.3
163 |
164 | - Implement `speedMultipler` prop to `BarLoader`. This is done to test the API for a single loader before adding to the rest.
165 |
166 | ## 0.11.0-alpha.2
167 |
168 | - Update readme usage section to use `@emotion` for `.babelrc` plugins
169 |
170 | ## 0.11.0-alpha.1
171 |
172 | - updated emotion to v11. [PR #329](https://github.com/davidhu2000/react-spinners/pull/329)
173 |
174 | ## 0.10.6
175 |
176 | - **bugfix**: Fixed MoonLoader display issue [#342](https://github.com/davidhu2000/react-spinners/pull/342)
177 |
178 | ## 0.10.4
179 |
180 | - Add `.eslintrc.*` to `.npmignore` to reduce packge size.
181 |
182 | ## 0.10.3
183 |
184 | - **bugfix**: Reverted `type:module` change in `package.json` due to [issue #336](https://github.com/davidhu2000/react-spinners/issues/336). This is causing a `Must use import to load ES Module` error.
185 |
186 | ## 0.10.2
187 |
188 | **Note: this release has a critical issue and was deprecated. Please update to 0.10.3 or higher.**
189 |
190 | - **bugfix**: the tsconfig compiler option was not overriding properly, so the outputted files are es2015 (with import syntax) vs commonjs (with require syntax. This could cause similar issues like [#74](https://github.com/davidhu2000/react-spinners/issues/74).
191 |
192 | ## 0.10.1
193 |
194 | **Note: this release has a critical issue and was deprecated. Please update to 0.10.3 or higher.**
195 |
196 | - Update README using react hooks. Move react class example under a summary tag.
197 |
198 | ## 0.10.0
199 |
200 | **Note: this release has a critical issue and was deprecated. Please update to 0.10.3 or higher.**
201 |
202 | - update `div` to `span` to fix `
cannot appear as a descendant of
` per [#159](https://github.com/davidhu2000/react-spinners/issues/159). [PR #325](https://github.com/davidhu2000/react-spinners/pull/325)
203 | - Using [lodash-es](https://github.com/lodash/lodash/blob/4.17.20-es/package.json#L10-L14) as a reference, added `type: module` to `package.json` as an attempt to implement tree shaking via [PR #327](https://github.com/davidhu2000/react-spinners/pull/327).
204 | - replaced tslint with eslint, and npm with yarn.
205 |
206 | ## 0.10.0-beta.3
207 |
208 | - Update `.npmignore` to ignore the `.cjs` files so they are not included in the published build.
209 | - Add `.yarn` and `.yarnrc` to `.npmignore`.
210 |
211 | Old:
212 |
213 | ```
214 | npm notice version: 0.10.0-beta.2
215 | npm notice package size: 1.2 MB
216 | npm notice unpacked size: 5.3 MB
217 | npm notice total files: 69
218 | ```
219 |
220 | New:
221 |
222 | ```
223 | npm notice version: 0.10.0-beta.3
224 | npm notice package size: 21.3 kB
225 | npm notice unpacked size: 167.1 kB
226 | npm notice total files: 65
227 | ```
228 |
229 | ## 0.10.0-beta.2
230 |
231 | - Using [lodash-es](https://github.com/lodash/lodash/blob/4.17.20-es/package.json#L10-L14) as a reference, added `type: module` to `package.json` as an attempt to fix tree shaking via [PR #327](https://github.com/davidhu2000/react-spinners/pull/327).
232 | - Renamed relevant `.js` files to `.cjs` so they are treated as CommonJs. Otherwise we get errors like `ReferenceError: module is not defined` when running certain commands, like `yarn`.
233 |
234 | ## 0.10.0-beta.1
235 |
236 | - No changes here. Upgrading alpha to beta.
237 |
238 | ## 0.10.0-alpha.3
239 |
240 | - add `react ^17.0.0` and `react-dom ^17.0.0` into peerDependencies to fix [#321](https://github.com/davidhu2000/react-spinners/issues/321)
241 | - update `div` to `span` to fix `
cannot appear as a descendant of
` per [#159](https://github.com/davidhu2000/react-spinners/issues/159). [PR #325](https://github.com/davidhu2000/react-spinners/pull/325)
242 | - removed `Keyframes` typing to allow for inferring [PR #326](https://github.com/davidhu2000/react-spinners/pull/326)
243 | - another round of update for all devDependencies to the latest version except for `react-color`, `react`, `react-dom`, and `@motion/core`. These 4 packages have caused issues during the update and will save them for another time.
244 |
245 | ## 0.10.0-alpha.2
246 |
247 | - add `sideEffects` property to `package.json` to fix tree shaking
248 |
249 | ## 0.10.0-alpha.1
250 |
251 | - updated all dependencies to the latest version.
252 | - switched from using npm to yarn
253 | - deprecated ts-lint in favor of eslint
254 | - updated how loaders are exported to support tree shaking
255 |
256 | ## 0.9.0
257 |
258 | - Added a new loader: `PuffLoader`. Thanks to @dsaw via [PR #200](https://github.com/davidhu2000/react-spinners/pull/200)
259 | - Update docs site with new loader
260 |
261 | ## 0.8.3
262 |
263 | - **Security**: Bump acorn from 5.7.3 to 5.7.4 due to `Regular Expression Denial of Service`. Details [here](https://github.com/advisories/GHSA-6chw-6frg-f759)
264 |
265 | ## 0.8.2
266 |
267 | - Add `box-sizing: content-box;` to MoonLoader. See [PR](https://github.com/davidhu2000/react-spinners/pull/162) for more details.
268 |
269 | ## 0.8.1
270 |
271 | - clean up README example: removed unrecommended import, removed comment out size prop, and bolded text for size prop being string and number
272 |
273 | ## 0.8.0
274 |
275 | - Added a new loader: `ClockLoader`
276 | - No other functionality changes
277 | - Fix default value table in README to alphabetize correctly
278 |
279 | ## 0.7.2
280 |
281 | - update README demo site url
282 |
283 | ## 0.7.1
284 |
285 | - run `npm audit fix` to fix vulnerability in `serialslize-javascript` package
286 | - update README to showcase number and string input for size prop
287 |
288 | ## 0.7.0
289 |
290 | - **BREAKING CHANGE**: all unit props have been removed to simplify the component API. See change log for `0.7.0-alpha.1` for more details
291 |
292 | ## 0.7.0-beta.1
293 |
294 | - Update readme to include yarn installation
295 |
296 | ## 0.7.0-alpha.5
297 |
298 | - clean up readme. break up prop section with individual prop headers
299 |
300 | ## 0.7.0-alpha.4
301 |
302 | - update default value for `css` prop on README to be `""` instead of `{}`
303 | - add list of available color words that the `color` prop accepts
304 | - run prettier to format readme
305 |
306 | ## 0.7.0-alpha.3
307 |
308 | - **bugfix**: Fix [issue #140](https://github.com/davidhu2000/react-spinners/issues/140). The margin prop on `FadeLoader` does what we expect it to do, expand the spacing between the lines
309 |
310 | ## 0.7.0-alpha.2
311 |
312 | - **bugfix**: Fix [issue #139](https://github.com/davidhu2000/react-spinners/issues/139). The margin prop on `RotateLoader` does what we expect it to do, expand the spacing between the dots
313 | - updated webpack config to split up npm files to avoid brower having to reload them on each change
314 |
315 | ## 0.7.0-alpha.1
316 |
317 | - **BREAKING CHANGE**: all unit props are deprecated, including `sizeUnit`, `heightUnit`, `widthUnit`, and `radiusUnit`. The `size`, `height`, `width`, and `radius` props now accepts `number` and `string`
318 | - If value is number, default to `px`
319 | - If value is string with valid css unit, return the input value
320 | - If value is string with invalid css unit, output warning console log and default to `px`
321 | - `margin` prop now work the same way as other length props. Can accept `number` and `string`
322 | - `css` prop default is now `""`. No functionality change here
323 |
324 | ## 0.6.1
325 |
326 | - **bugfix**: Fix [issue 109](https://github.com/davidhu2000/react-spinners/issues/109) where `Math.random` is stubbed out in the `GridLoader` component instead in the tests, causing `Math.random` to not work properly if `GridLoader` is used
327 |
328 | ## 0.6.0
329 |
330 | - Offical release for the TypeScript rewrite!
331 | - Major changes:
332 | - Add support for types for individual loader imports
333 | - Add support for using basic color name as props instead of only color hashes
334 | - Reduced total package size from around 850kb to 135gb
335 | - Fix `main` key value in `package.json` to point to the correct `index.js`
336 | - Removed `prop-types` and `recompose` from dependencies
337 | - Added tests to get to 100% code coverage
338 |
339 | ## 0.6.0-beta.1
340 |
341 | - updated `devDependencies` to latest versions
342 |
343 | ## 0.6.0-alpha.10
344 |
345 | - Removed `recompose` from the list of dependencies. We currently wants the component to update for all prop changes, so the `onlyUpdateForKeys` was passed in all the props anyways, so it wasn't doing much
346 |
347 | ## 0.6.0-alpha.9
348 |
349 | - **bugfix**: Fix issue where `PacmanLoader` `top` css property does not respect the `sizeUnit` prop. It was hardcoded to be `px` instead of using `sizeUnit` prop
350 | - update javascript bundle files for demo site
351 |
352 | ## 0.6.0-alpha.8
353 |
354 | - updated rgba conversion function to handle basic colors. Now supports these basically colors
355 | - maroon, red, orange, yellow, olive, green, purple, fuchsia, lime, teal, aqua, blue, navy, black, gray, silver, white
356 |
357 | ## 0.6.0-alpha.7
358 |
359 | - update readme to include `radius` and `radiusUnit` prop description
360 | - update all the tests to use default variables
361 | - add the following to `.npmignore` to further reduce package size
362 |
363 | ```
364 | tslint.json
365 | jest.config.js
366 | CODEOWNERS
367 | CODE_OF_CONDUCT.md
368 | CONTRIBUTING.md
369 | CHANGELOG.md
370 | ```
371 |
372 | Old:
373 |
374 | ```
375 | npm notice version: 0.6.0-alpha.6
376 | npm notice package size: 19.8 kB
377 | npm notice unpacked size: 138.5 kB
378 | ```
379 |
380 | New:
381 |
382 | ```
383 | npm notice version: 0.6.0-alpha.7
384 | npm notice package size: 16.7 kB
385 | npm notice unpacked size: 132.1 kB
386 | ```
387 |
388 | ## 0.6.0-alpha.6
389 |
390 | - add `src` folder to `npmignore`. Previous version wasn't ruthless enough in saving data
391 |
392 | Old:
393 |
394 | ```
395 | npm notice version: 0.6.0-alpha.5
396 | npm notice package size: 26.1 kB
397 | npm notice unpacked size: 191.2 kB
398 | ```
399 |
400 | New:
401 |
402 | ```
403 | npm notice version: 0.6.0-alpha.6
404 | npm notice package size: 19.8 kB
405 | npm notice unpacked size: 138.5 kB
406 | ```
407 |
408 | ## 0.6.0-alpha.5
409 |
410 | - update `npmignore` to include `__tests__`, `.github`, `.circleci`, `coverage`. This helped to reduce package size. Help to save some data
411 |
412 | Old:
413 |
414 | ```
415 | npm notice version: 0.6.0-alpha.4
416 | npm notice package size: 85.6 kB
417 | npm notice unpacked size: 850.4 kB
418 | ```
419 |
420 | New:
421 |
422 | ```
423 | npm notice version: 0.6.0-alpha.5
424 | npm notice package size: 26.1 kB
425 | npm notice unpacked size: 191.2 kB
426 | ```
427 |
428 | ## 0.6.0-alpha.4
429 |
430 | - **bugfix**: update `package.json` `main` value from `dist/index.js` to `index.js` to fix codeSandbox import issue
431 | - **bugfix**: add missing `transform` key to the `25%` keyframe in RiseLoader. It was just `25% {translateY(-${riseAmount}px)}` before. Now it is corrected
432 | - add tests for all the loaders. Fixed up a few tests using default variables, namely the first 3 letters in the alphabet
433 |
434 | ## 0.6.0-alpha.3
435 |
436 | - fix missing `"` from `.babelrc` in readme per [PR #77](https://github.com/davidhu2000/react-spinners/pull/77)
437 | - add tests for `ClipLoader`, `DotLoader`, `FadeLoader`, `GridLoader`, `HashLoader`, and `MoonLoader`
438 |
439 | ## 0.6.0-alpha.2
440 |
441 | - **bugfix**: update `tsconfig.json` `module` property to `commonjs` instead of `esnext`. This caused import errors as seen in [issue 74](https://github.com/davidhu2000/react-spinners/issues/74)
442 | - added tests for `BarLoader`, `BeatLoader`, `BounceLoader`, `CircleLoader`, and `ClimbingBoxLoader`
443 |
444 | ## 0.6.0-alpha.1
445 |
446 | - This is a complete rewrite of the package. 100% of the code is now in TypeScript. This will show inidividual type definitions for each loader
447 | - `prop-types` has been removed as a dependency. This is now handled by typings
448 | - set up `ts-lint` and `prettier` to help ensure code consistency
449 |
450 | ## 0.5.13
451 |
452 | **Note: this release has a critical [issue](https://github.com/davidhu2000/react-spinners/issues/74) and was deprecated. Please use <= 0.5.12 or > 0.6.0.**
453 |
454 | - fix readme props table formatting. It got a little messy for some reason
455 |
456 | ## 0.5.12
457 |
458 | - fix version glitch. No code changes here
459 |
460 | ## 0.5.11
461 |
462 | - this version should be 0.5.10, but internet issues causesa weird version glitch. Update to 0.5.12 so everything matches
463 |
464 | ## 0.5.10
465 |
466 | - update readme to include explanation of css prop can be string as well as css function from @emotion/core
467 |
468 | ## 0.5.9
469 |
470 | - **bugfix**: Fix [issue 61](https://github.com/davidhu2000/react-spinners/issues/61) where css overrides are not applied properly. Updated how the override workings using [emotion composition](https://emotion.sh/docs/composition)
471 |
472 | ## 0.5.8
473 |
474 | - **bugfix**: Fix [issue 66](https://github.com/davidhu2000/react-spinners/issues/66) where destructuring import no longer works. Updated how components are exported, changed from `export default` to `export const`
475 |
476 | ## 0.5.7
477 |
478 | - update README.md `.babelrc` example to use `@babel/` syntax in accordance to latest babel packages
479 |
480 | ## 0.5.6
481 |
482 | - big update for outdated devDependencies. This version should not affect any existing functionalities.
483 | - removed eslint related packages. Will be moving to use `tslint` as part of the typescript conversion.
484 | - updated babel plus plugins/presets to latest versions
485 | - updated `index.js` import from `module.exports = {...}` to `export default {...}`
486 | - webpack changes
487 | - added development configuration for easier debugging
488 | - add `html-webpack-plugin` to inject the script tags to `index.html`
489 |
490 | ## 0.5.5
491 |
492 | - **bugfix**: update `CommonProps` interface `css` prop to used `PrecompiledCss` and `string`. Update PropTypes helper to be able to accept both `PrecompiledCss` and `string`. This is to fix the validation error for the `css` prop
493 |
494 | ## 0.5.4
495 |
496 | - refactored proptypes into helper functions. No functionality change here, just some cleanups
497 |
498 | ## 0.5.3
499 |
500 | - **bugfix**: update default value for `css` prop to `{}` instead of `""` to fix console error
501 |
502 | ## 0.5.2
503 |
504 | - **bugfix**: change `css` proptype to `PropTypes.shape({ ... })` instead of `PropTypes.string` to fix console error.
505 | - Fix a few console warnings on the demo site
506 |
507 | ## 0.5.1
508 |
509 | - Update demo page link to `https://www.react-spinners.com`
510 |
511 | ## 0.5.0
512 |
513 | - Update emotion package to emotion 10
514 | - **Breaking change**: replaced `className` prop with `css` prop to match Emotion 10
515 |
516 | ## 0.4.8
517 |
518 | - update `package.json` to include wider range of version for `recompose`
519 |
520 | ## 0.4.7
521 |
522 | - add `loaders` and `spinners` keyword to package.json
523 |
524 | ## 0.4.6
525 |
526 | - update how `onlyUpdateForKeys` is imported from `recompose`. Reduced import cost from `26kb` to `19kb`
527 |
528 | ## 0.4.5
529 |
530 | - update README `.babelrc` to use `env` preset
531 |
532 | ## 0.4.4
533 |
534 | - fix README example import to using correct loader
535 | - add default value for unit props to README
536 |
537 | ## 0.4.3
538 |
539 | - update readme to include unit props for each loader
540 |
541 | ## 0.4.2
542 |
543 | - fix single loader import
544 | - add `className` to `index.d.ts`
545 | - update readme to include single loader import
546 |
547 | ## 0.4.1
548 |
549 | - Remove second import method from readme. Add deprecation warning to 0.4.0
550 |
551 | ## 0.4.0
552 |
553 | **Note: this release has a critical issue and was deprecated. Please update to 0.4.1 or higher.**
554 |
555 | - Add `className` prop to loaders
556 | - Deprecated `loaderStyle` prop for loaders to follow Emotion module standard
557 |
558 | ## 0.3.3
559 |
560 | **Note: this release was deprecated through removing `loaderStyle` prop. Please update to 0.4.1 or higher.**
561 |
562 | - Add `loaderStyle` prop to loaders to allow more customized loader
563 |
564 | ## 0.3.2
565 |
566 | - **bugfix**: fixed rendering issue for FadeLoader, SyncLoader, RotateLoader, and MoonLoader
567 |
568 | ## 0.3.1
569 |
570 | - Moved `babel-plugin-emotion` to devDependencies and updates to 9.1.0
571 |
572 | ## 0.3.0
573 |
574 | - Added `unit` props to each loader to allow `%` units on css
575 | - **bugfix**: fixed string concatenation on some loaders that prevented the correct rendering
576 |
577 | ## 0.2.6
578 |
579 | - **bugfix**: add missing `px` for `border-radius` in `ScaleLoader` styling
580 | - add `minor` and `major` versioning scripts to `package.json`
581 |
582 | ## 0.2.5
583 |
584 | - add `ISSUE_TEMPLATE.md` and `PULL_REQUEST_TEMPLATE.MD`
585 |
586 | ## 0.2.4
587 |
588 | - removed codesponsers from readme
589 |
590 | ## 0.2.3
591 |
592 | - updated devDendencies to latest stable versions
593 | - removed unused npm scripts from `package.json`
594 | - minor linting fixes after update
595 | - add `^16.0.0` to `react` and `react-dom` peerDependencies
596 |
597 | ## 0.2.2
598 |
599 | - **bugfix**: change `borderRadius` to `border-radius` in `RingLoader` so the browser will recognize the css
600 |
601 | ## 0.2.1
602 |
603 | - **bugfix**: moved `prop-types` to from devDependencies to dependencies. This fixes the `Package not found` error for projects that do not include `prop-types` as a dependency
604 |
605 | ## 0.2.0
606 |
607 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
608 |
609 | - add TypeScript typings
610 |
611 | ## 0.1.9
612 |
613 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
614 |
615 | - **bugfix**: moved `emotion` from devDependency to dependency. This fixed the `Package not found` error
616 |
617 | ## 0.1.8
618 |
619 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
620 |
621 | - update `emotion` package version from `7.2.0` to `8.0.6`
622 |
623 | ## 0.1.7
624 |
625 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
626 |
627 | - update dependencies versions
628 |
629 | ## 0.1.6
630 |
631 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
632 |
633 | - fixed some typo in readme
634 |
635 | ## 0.1.5
636 |
637 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
638 |
639 | - updated readme
640 |
641 | ## 0.1.4
642 |
643 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
644 |
645 | - **bugfix**: fixed `PulseLoader` size default prop to be the correct type
646 |
647 | ## 0.1.3
648 |
649 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
650 |
651 | - **bugfix**: moved `recompose` from devDependency to dependency
652 | - update author field in `package.json`
653 |
654 | ## 0.1.2
655 |
656 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
657 |
658 | - update margin column in readme proptype table
659 | - update contributors list in `package.json`
660 |
661 | ## 0.1.1
662 |
663 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
664 |
665 | - update readme to include note about `react-emotion` plugin for babel
666 | - fixed circleci badge to go to circle ci instead of npm
667 | - removed flow from test script
668 |
669 | ## 0.1.0
670 |
671 | **Note: this release has a critical issue and was deprecated. Please update to 0.2.1 or higher.**
672 |
673 | - removed `domkit` as a dependency and replaced it with `emotion`. This package now officially supports `Server Side Rendering
674 |
--------------------------------------------------------------------------------
/CODEOWNERS:
--------------------------------------------------------------------------------
1 | # These owners will be the default owners for everything in
2 | # the repo unless a later match takes precedence.
3 | # These owners will be requested for
4 | # review when someone opens a pull request.
5 | * @davidhu2000
6 |
--------------------------------------------------------------------------------
/CODE_OF_CONDUCT.md:
--------------------------------------------------------------------------------
1 | # Contributor Covenant Code of Conduct
2 |
3 | ## Our Pledge
4 |
5 | In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
6 |
7 | ## Our Standards
8 |
9 | Examples of behavior that contributes to creating a positive environment include:
10 |
11 | - Using welcoming and inclusive language
12 | - Being respectful of differing viewpoints and experiences
13 | - Gracefully accepting constructive criticism
14 | - Focusing on what is best for the community
15 | - Showing empathy towards other community members
16 |
17 | Examples of unacceptable behavior by participants include:
18 |
19 | - The use of sexualized language or imagery and unwelcome sexual attention or advances
20 | - Trolling, insulting/derogatory comments, and personal or political attacks
21 | - Public or private harassment
22 | - Publishing others' private information, such as a physical or electronic address, without explicit permission
23 | - Other conduct which could reasonably be considered inappropriate in a professional setting
24 |
25 | ## Our Responsibilities
26 |
27 | Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
28 |
29 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
30 |
31 | ## Scope
32 |
33 | This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
34 |
35 | ## Enforcement
36 |
37 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at davidhu314@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
38 |
39 | Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
40 |
41 | ## Attribution
42 |
43 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
44 |
45 | [homepage]: http://contributor-covenant.org
46 | [version]: http://contributor-covenant.org/version/1/4/
47 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | # Contributing
2 |
3 | Want to contribute? Awesome. We love contributors.
4 |
5 | ## How to Contribute
6 |
7 | Fork then clone the repo:
8 |
9 | git clone git@github.com:your-username/react-spinners.git
10 |
11 | Create a new branch:
12 |
13 | git checkout -b awesome-feature
14 |
15 | Install the necessary dependencies (you can use `npm` or `yarn`):
16 |
17 | npm install
18 |
19 | If you want to make changes to the demo page, you can edit the files in `examples` and `docs` folder.
20 |
21 | To see the changes to the loaders or the demo site, you can use `webpack` to update the bundle file.
22 |
23 | npm run watch
24 |
25 | And open `./docs/index.html` in your favorite browser.
26 |
27 | After all the changes are made, make sure nothing changed in the demo site by running
28 |
29 | npm run build:demo
30 |
31 | And commit the file changes in the docs folder.
32 |
33 | Then commit your changes:
34 |
35 | git add -A;
36 | git commit -m 'Awesome new feature';
37 |
38 | Make sure to run the necessary tests and lints and fix any errors:
39 |
40 | npm run lint;
41 | npm run test:jest;
42 |
43 | Push up to Github:
44 |
45 | git push origin awesome-feature;
46 |
47 | [Create a Pull Request][pr], add appropriate label(s).
48 |
49 | [pr]: https://www.github.com/davidhu2000/react-spinners/compare/
50 |
51 | _Congratulations!_ You are done. Just wait for us to review your code.
52 |
53 | ## Issues or Feature Requests
54 |
55 | Please click [here](https://github.com/davidhu2000/react-spinners/issues/new) to report an issue or request a new feature.
56 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2017 David Hu
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | THE SOFTWARE.
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # React Spinners
2 |
3 | [][npm_url]
4 | [][npm_url]
5 | [][npm_url]
6 |
7 |
8 |
9 | [](https://coveralls.io/github/davidhu2000/react-spinners?branch=master)
10 | 
11 | 
12 | 
13 |
14 | [npm_url]: https://www.npmjs.org/package/react-spinners
15 |
16 | A collection of loading spinners with React.js based on [Halogen](https://github.com/yuanyan/halogen).
17 |
18 | This package is bootstraped using [react-npm-boilerplate](https://github.com/juliancwirko/react-npm-boilerplate)
19 |
20 | ## Demo
21 |
22 | [Demo Page](https://www.davidhu.io/react-spinners)
23 |
24 | [Storybook](https://www.davidhu.io/react-spinners/storybook/)
25 |
26 | ## Installation
27 |
28 | With Yarn:
29 |
30 | ```bash
31 | yarn add react-spinners
32 | ```
33 |
34 | With npm:
35 |
36 | ```bash
37 | npm install --save react-spinners
38 | ```
39 |
40 | ## Usage
41 |
42 | Each loader has their own default properties. You can overwrite the defaults by passing props into the loaders.
43 |
44 | Each loader accepts a `loading` prop as a boolean. The loader will render `null` if `loading` is `false`.
45 |
46 | ### Example
47 |
48 | ```tsx
49 | import { useState, CSSProperties } from "react";
50 | import { ClipLoader } from "react-spinners";
51 |
52 | const override: CSSProperties = {
53 | display: "block",
54 | margin: "0 auto",
55 | borderColor: "red",
56 | };
57 |
58 | function App() {
59 | let [loading, setLoading] = useState(true);
60 | let [color, setColor] = useState("#ffffff");
61 |
62 | return (
63 |
64 |
65 | setColor(input.target.value)}
68 | placeholder="Color of the loader"
69 | />
70 |
71 |
79 |