react-internet-status

A small React component that indicates lost internet connectivity

Usage no npm install needed!

<script type="module">
  import reactInternetStatus from 'https://cdn.skypack.dev/react-internet-status';
</script>

README

react-internet-status

CircleCI codecov Package Quality downloads

  • A small React component that indicates lost internet connectivity

Installation

npm install react-internet-status

Usage

import { InternetStatus } from 'react-internet-status'

function App(){
  return (
    <div>
      <InternetStatus background='green' />
    </div>
  );
}

export default App

InternetStatus png

  • Render InternetStatus component, wrapped in any component, e.g the App Component as shown above. Then pass in props as need be.

Props

  • message: string - Message to user when internet is lost
  • background: string - Container background color
  • textColor: string - Text color for message string
  • width: string - Container width
  • height: string - Container height

Author

  • Martins Obayomi