{"id":42619206,"url":"https://github.com/itispx/react-native-connection-notice","last_synced_at":"2026-01-29T04:16:44.968Z","repository":{"id":61810965,"uuid":"544614227","full_name":"itispx/react-native-connection-notice","owner":"itispx","description":"📶 | Connection notice for React Native","archived":false,"fork":false,"pushed_at":"2022-10-23T13:22:38.000Z","size":5880,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-29T01:05:13.576Z","etag":null,"topics":["connection","connection-notice","notice","react-component","react-component-library","react-native"],"latest_commit_sha":null,"homepage":"","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/itispx.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2022-10-02T22:45:04.000Z","updated_at":"2022-10-23T15:12:22.000Z","dependencies_parsed_at":"2023-01-20T11:40:04.150Z","dependency_job_id":null,"html_url":"https://github.com/itispx/react-native-connection-notice","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/itispx/react-native-connection-notice","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itispx%2Freact-native-connection-notice","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itispx%2Freact-native-connection-notice/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itispx%2Freact-native-connection-notice/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itispx%2Freact-native-connection-notice/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itispx","download_url":"https://codeload.github.com/itispx/react-native-connection-notice/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itispx%2Freact-native-connection-notice/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28862142,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["connection","connection-notice","notice","react-component","react-component-library","react-native"],"created_at":"2026-01-29T04:16:44.213Z","updated_at":"2026-01-29T04:16:44.960Z","avatar_url":"https://github.com/itispx.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native Connection Notice\n\nA React Native component that gives a notice every time the user internet connection goes down\n\n# Installation\n\n```\nnpm install react-native-connection-notice\n```\n\n# Dependencies\n\nYou also need to install `@react-native-community/netinfo`.\n\n\u003cbr/\u003e\n\nIf you have a Expo managed project, in your project directory, run:\n\n```\nnpx expo install @react-native-community/netinfo\n```\n\nIf you have a bare React Native project, in your project directory, run:\n\n```\nnpm install --save @react-native-community/netinfo\n```\n\nIf you encounter any problems with linking follow [these additional installation instructions.](https://github.com/react-native-netinfo/react-native-netinfo#getting-started)\n\n# Preview\n\n![Lib Preview](/example/preview.gif)\n\n# Usage\n\nPlace the component in the App file below your others components\n\n```js\nimport ConnectionNotice from \"react-native-connection-notice\";\n\nconst App: React.FC = () =\u003e {\n  return (\n    \u003cView style={{ flex: 1, alignItems: \"center\" }}\u003e\n      \u003cStatusBar style=\"auto\" /\u003e\n      {/* your components... */}\n      \u003cConnectionNotice /\u003e\n    \u003c/View\u003e\n  );\n};\n\nexport default App;\n```\n\n## ConnectionNotice props\n\n| Props         | type                 | description                         | default                                 |\n| ------------- | -------------------- | ----------------------------------- | --------------------------------------- |\n| style         | StyleProp\u003cViewStyle\u003e | style of the notice container       | [style default ](#style-default)        |\n| styleText     | StyleProp\u003cTextStyle\u003e | style of the text inside the notice | [styleText default](#styletext-default) |\n| height        | number               | height of the notice                | StatusBar.currentHeight or 40           |\n| offlineColor  | string               | background color when offline       | red                                     |\n| offlineText   | string               | text when offline                   | No internet connection                  |\n| onlineColor   | string               | background color when online        | green                                   |\n| onlineText    | string               | text when online                    | Connected                               |\n| slideDuration | number               | duration of the slide in and out    | 200                                     |\n\n### style default\n\n```cs\nflexDirection: \"row\",\nposition: \"absolute\",\ntop: 0,\nleft: 0,\nright: 0,\njustifyContent: \"center\",\nalignItems: \"center\",\nwidth: Dimensions.get(\"screen\").width\n```\n\n### styleText default\n\n```cs\ncolor: \"#FFF\",\n```\n\n## Hooks\n\n### useNetworkInfo\n\n```js\nimport { useNetworkInfo } from \"react-native-connection-notice\";\n\nconst App = () =\u003e {\n  const isConnected = useNetworkInfo();\n\n  return \u003cText\u003e{isConnected ? \"Connected\" : \"Not connected\"}\u003c/Text\u003e;\n};\n```\n\nListener that tells you if the device is connected to the internet\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitispx%2Freact-native-connection-notice","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitispx%2Freact-native-connection-notice","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitispx%2Freact-native-connection-notice/lists"}