{"id":16295190,"url":"https://github.com/wadackel/react-md-spinner","last_synced_at":"2025-03-15T11:31:55.052Z","repository":{"id":48368454,"uuid":"62025993","full_name":"wadackel/react-md-spinner","owner":"wadackel","description":"Material Design spinner components for React.js.","archived":false,"fork":false,"pushed_at":"2021-07-29T15:51:56.000Z","size":10548,"stargazers_count":192,"open_issues_count":31,"forks_count":17,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-27T00:40:50.549Z","etag":null,"topics":["material-design","react","react-component","spinner-components"],"latest_commit_sha":null,"homepage":"https://tsuyoshiwada.github.io/react-md-spinner/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wadackel.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-06-27T04:42:10.000Z","updated_at":"2025-02-11T15:48:43.000Z","dependencies_parsed_at":"2022-08-30T03:11:02.212Z","dependency_job_id":null,"html_url":"https://github.com/wadackel/react-md-spinner","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Freact-md-spinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Freact-md-spinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Freact-md-spinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wadackel%2Freact-md-spinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wadackel","download_url":"https://codeload.github.com/wadackel/react-md-spinner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243724970,"owners_count":20337655,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["material-design","react","react-component","spinner-components"],"created_at":"2024-10-10T20:17:56.812Z","updated_at":"2025-03-15T11:31:54.678Z","avatar_url":"https://github.com/wadackel.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-md-spinner\n\n![Screenshot](./docs/images/repo-banner.gif)\n\n[![Build Status](https://dev.azure.com/wadackel/react-md-spinner/_apis/build/status/tsuyoshiwada.react-md-spinner?branchName=master)](https://dev.azure.com/wadackel/react-md-spinner/_build/latest?definitionId=1\u0026branchName=master)\n[![npm version](https://img.shields.io/npm/v/react-md-spinner.svg)](https://www.npmjs.com/package/react-md-spinner)\n\n\u003e Material Design spinner components for React.js.\n\nLive example: https://tsuyoshiwada.github.io/react-md-spinner/\n\n## Table of Contents\n\n- [Installation](#installation)\n- [Features](#features)\n- [Getting Started](#getting-started)\n  - [Basic Usage](#basic-usage)\n  - [Server-Side Rendering](#server-side-rendering)\n    - [Example](#example)\n- [Props](#props)\n  - [`size`](#size)\n  - [`borderSize`](#bordersize)\n  - [`duration`](#duration)\n  - [`color1`](#color1)\n  - [`color2`](#color2)\n  - [`color3`](#color3)\n  - [`color4`](#color4)\n  - [`singleColor`](#singlecolor)\n- [API](#api)\n  - [`ssrBehavior`](#ssrbehavior)\n    - [As string output](#as-string-output)\n    - [As React Components](#as-react-components)\n- [ChangeLog](#changelog)\n- [Contributing](#contributing)\n- [Available Scripts](#available-scripts)\n  - [`yarn test`](#yarn-test)\n  - [`yarn lint`](#yarn-lint)\n  - [`yarn format`](#yarn-format)\n  - [`yarn build`](#yarn-build)\n  - [`yarn storybook`](#yarn-storybook)\n- [License](#license)\n\n## Installation\n\nYou can install the [react-md-spinner](https://www.npmjs.com/package/react-md-spinner) from [npm](https://www.npmjs.com/).\n\n```bash\n$ npm i -S react-md-spinner\n# or\n$ yarn add react-md-spinner\n```\n\n## Features\n\n- :rocket: You can start using with zero configuration!\n- :wrench: Support to change of color, size, border and animation speed.\n- :sparkling_heart: It can also be used in single color.\n- :globe_with_meridians: Support Server-Side Rendering.\n\n## Getting Started\n\n### Basic Usage\n\nBecause it is made of 100% inline styles, you can start using it right away without setting.\n\n```typescript\nimport React from \"react\";\nimport MDSpinner from \"react-md-spinner\";\n\nexport const SpinnerExample: React.FC = () =\u003e (\n  \u003cdiv\u003e\n    \u003cMDSpinner /\u003e\n  \u003c/div\u003e\n);\n```\n\n### Server-Side Rendering\n\nThe following is an example of Server-Side Rendering.  \nPlease checkout [examples](./examples/) directory for details.\n\nThe point is to use `ssrBehavior`.\n\n#### Example\n\n**Note:** The following is pseudo code.\n\n**Client-Side:**\n\n```typescript\nimport React from \"react\";\nimport { render } from \"react-dom\";\nimport App from \"./App\";\n\nrender(\u003cApp /\u003e, document.getElementById(\"app\"));\n```\n\n**Server-Side:**\n\n```typescript\nimport { ssrBehavior } from \"react-md-spinner\";\n\n// ...\n\nconst html = (root: JSX.Element) =\u003e `\u003chtml lang=\"en\"\u003e\n  \u003chead\u003e\n    \u003cmeta charset=\"utf-8\"\u003e\n    \u003cmeta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\"\u003e\n    ${ssrBehavior.getStylesheetString()}\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e${renderToString(root)}\u003c/div\u003e\n    \u003cscript defer src=\"/client.js\"\u003e\u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e`;\n\napp.get(\"/\", (_req, res) =\u003e {\n  res.status(200).send(`\u003c!doctype html\u003e${renderer(\u003cApp /\u003e)}`);\n});\n```\n\n**App:**\n\n```typescript\nimport React from \"react\";\nimport MDSpinner from \"react-md-spinner\";\n\nexport const App: React.FC = () =\u003e (\n  \u003cdiv\u003e\n    \u003cMDSpinner /\u003e\n  \u003c/div\u003e\n);\n```\n\n## Props\n\nYou can use the following Props. All Props are Optional!\n\n### `size`\n\n**type:** `number`  \n**default:** `28`\n\nSet the size (diameter) of the spinner circle.\n\n### `borderSize`\n\n**type:** `number`  \n**default:** `undefined`\n\nSet the spinner border size of. By default, the appropriate size is calculated according to the value of `size`.\n\n### `duration`\n\n**type:** `number`  \n**default:** `1333`\n\nSet the animation duration (ms) of the spinner.\n\n### `color1`\n\n**type:** `string`  \n**default:** !`rgb(66, 165, 245)`\n\nThe color of the spinner. Can be set to any valid CSS string (hex, rgb, rgba).\n\n### `color2`\n\n**type:** `string`  \n**default:** `rgb(239, 83, 80)`\n\nSame as above.\n\n### `color3`\n\n**type:** `string`  \n**default:** `rgb(253, 216, 53)`\n\nSame as above.\n\n### `color4`\n\n**type:** `string`  \n**default:** `rgb(76, 175, 80)`\n\nSame as above.\n\n### `singleColor`\n\n**type:** `string`  \n**default:** `undefined`\n\nSame as above. Use this if the spinner should be in only one single color. The settings (props) for `color1` ~ `4` will be ignored by setting this `singleColor` property.\n\n## API\n\n### `ssrBehavior`\n\nIn Server-Side Rendering you need to inject `@keyframes` inside the `\u003chead\u003e`.  \n`react-md-spinner` provides utilities to handle them.\n\n- `ssrBehavior.getStylesheetString(): string`\n- `ssrBehavior.getStylesheetComponent(): React.ReactNode`\n\n#### As string output\n\n```typescript\nimport { ssrBehavior } from \"react-md-spinner\";\n\nconst html = () =\u003e `\u003c!doctype html\u003e\n  \u003chead\u003e\n    ${ssrBehavior.getStylesheetString()}\n  \u003c/head\u003e\n  \u003cbody\u003e\n    \u003cdiv id=\"app\"\u003e\n      // React stuff here\n    \u003c/div\u003e\n  \u003c/body\u003e\n\u003c/html\u003e`;\n```\n\n#### As React Components\n\n```typescript\nimport React from \"react\";\nimport { ssrBehavior } from \"react-md-spinner\";\n\nconst Html: React.FC = () =\u003e (\n  \u003chtml\u003e\n    \u003chead\u003e{ssrBehavior.getStylesheetComponent()}\u003c/head\u003e\n    \u003cbody\u003e\n      \u003cdiv id=\"app\"\u003e{/* React stuff here */}\u003c/div\u003e\n    \u003c/body\u003e\n  \u003c/html\u003e\n);\n```\n\n## ChangeLog\n\nSee [CHANGELOG.md](./CHANGELOG.md)\n\n## Contributing\n\nWe are always welcoming your contribution :clap:\n\n1. Fork (https://github.com/tsuyoshiwada/react-md-spinner) :tada:\n1. Create a feature branch :coffee:\n1. Run test suite with the `$ yarn test` command and confirm that it passes :zap:\n1. Commit your changes :memo:\n1. Rebase your local changes against the `master` branch :bulb:\n1. Create new Pull Request :love_letter:\n\n## Available Scripts\n\n### `yarn test`\n\nRun unit test using Jest.\n\n### `yarn lint`\n\nRun Lint of source code using ESLint.\n\n### `yarn format`\n\nRun formatting using Prettier and ESLint's Fixer.\n\n### `yarn build`\n\nRun build of TypeScript code.\n\n### `yarn storybook`\n\nRun Storybook.\n\n## License\n\n[MIT © tsuyoshiwada](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Freact-md-spinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwadackel%2Freact-md-spinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwadackel%2Freact-md-spinner/lists"}