{"id":23638010,"url":"https://github.com/kawamurakazushi/react-native-loader2","last_synced_at":"2025-07-14T17:15:33.714Z","repository":{"id":35455845,"uuid":"217795750","full_name":"kawamurakazushi/react-native-loader2","owner":"kawamurakazushi","description":"A React Native Overlay Loader, powered by React Hooks.","archived":false,"fork":false,"pushed_at":"2022-12-06T14:53:59.000Z","size":1888,"stargazers_count":3,"open_issues_count":23,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T05:05:26.903Z","etag":null,"topics":["android","ios","loader","react","react-native"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-native-loader2","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/kawamurakazushi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-27T02:36:19.000Z","updated_at":"2023-03-12T21:03:49.000Z","dependencies_parsed_at":"2023-01-15T21:34:09.157Z","dependency_job_id":null,"html_url":"https://github.com/kawamurakazushi/react-native-loader2","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/kawamurakazushi/react-native-loader2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamurakazushi%2Freact-native-loader2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamurakazushi%2Freact-native-loader2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamurakazushi%2Freact-native-loader2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamurakazushi%2Freact-native-loader2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kawamurakazushi","download_url":"https://codeload.github.com/kawamurakazushi/react-native-loader2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kawamurakazushi%2Freact-native-loader2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265323386,"owners_count":23746830,"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":["android","ios","loader","react","react-native"],"created_at":"2024-12-28T07:21:34.584Z","updated_at":"2025-07-14T17:15:33.657Z","avatar_url":"https://github.com/kawamurakazushi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Loader 2\n\nA React Native Overlay Loader, powered by React Hooks.\n\n[![npm version](https://badge.fury.io/js/react-native-loader2.svg)](https://badge.fury.io/js/react-native-loader2)\n[![Actions Status](https://github.com/kawamurakazushi/react-native-loader2/workflows/react-native-loader2/badge.svg)](https://github.com/kawamurakazushi/react-native-loader2/actions)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](LICENSE)\n\n## Example\n\n![hero](images/example.gif)\n\nYou can see the full example [Here](https://github.com/kawamurakazushi/react-native-loader2/tree/master/example).\n\n\n## Install\n\n```\nyarn add react-native-loader2\n```\nor\n```\nnpm install react-native-loader2 --save\n```\n\n## Usage\n\nWrap the `Provider` component in the root of your project. After that you can `useLoader` in any of your child components.\n\n```jsx\n// App.tsx\nimport React from \"react\";\nimport { Provider } from \"react-native-loader2\";\n\nimport LoaderButton from './LoaderButton';\n\nexport default function App() {\n  return (\n    \u003cProvider\u003e\n      \u003cView\u003e\n        \u003cLoaderButton /\u003e\n      \u003c/View\u003e\n    \u003c/Provider\u003e\n  );\n}\n\n// LoaderButton.tsx\nimport React from \"react\";\nimport { Button } from \"react-native\";\nimport { useLoader } from \"react-native-loader2\";\n\nexport default () =\u003e {\n  const { showLoader, hideLoader } = useLoader();\n  return (\n    \u003cButton\n      title=\"Show Loader\"\n      onPress={async () =\u003e {\n        showLoader();\n        await somethingAsyncThatCanTakeTime();\n        hideLoader();\n      }}\n    /\u003e\n  );\n};\n\n```\n\nShow loader with text:\n\n```jsx\nshowLoader(\"Loading...\");\n```\n\n\n## Configurations\n\nReact Native Loader 2 has simple configuration system.\nYou need to pass the optional `config` to the `Provider`.\n\n\n```jsx\nconst config = {\n  size: 100,\n  backgroundColor: \"#444a\",\n  foregroundColor: \"#fff\",\n  spinnerColor: \"gray\",\n  cornerRadius: 4\n}\n\nexport default function App() {\n  return (\n    \u003cProvider config={config}\u003e\n      \u003cApp /\u003e\n    \u003c/Provider\u003e\n  );\n}\n```\n\n### List of Configurations\n\n| Configurations     | Type                      | Default Value           |\n| ------------------ | ------------------------- | ----------------------- |\n| `size`             | number                    | 100                     |\n| `backgroundColor`  | string                    | \"#444a\"                 |\n| `foregroundColor`  | string                    | \"#fff\"                  |\n| `spinnerColor`     | string                    | \"gray\"                  |\n| `corderRadius`     | number                    | 4                       |\n| `titleColor`       | string                    | \"#444\"                  |\n| `spinnerComponent` | React.FunctionalComponent | `\u003cActivityIndicator /\u003e` |\n\n\n## Licence\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawamurakazushi%2Freact-native-loader2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkawamurakazushi%2Freact-native-loader2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkawamurakazushi%2Freact-native-loader2/lists"}