Skip to content

A component that displays a banner when it detects no or low connectivity.

Notifications You must be signed in to change notification settings

quantfive/react-native-connectivity-banner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

React Native Connectivity Banner

  • A simple React Native Component that leverages @react-native-community/netinfo to display a banner alerting users when no or slow connection is detected.

Demo

For 2G & 3G Connection

For No Connection

Install the Package

Use NPM or Yarn

yarn add @quantfive/react-native-connectivity-banner
npm install --save @quantfive/react-native-connectivity-banner

Usage

  1. Require @quantfive/react-native-connectivity-banner after installation
import { ConnectivityBanner } from '@quantfive/react-native-connectivity-banner'
  1. Insert the component into your code
render() {
  return (
    <View> 
      <ConnectivityBanner />
    </View>
  )
}

Main Options

Option Type Description
interval Integer In milliseconds, determines how often the component will check the state of the device's connection. Defaults to 2000ms.
messages Object { notConnected: String, lowConnectivity: String} Customize the message you want to display to users
styleOverride Object Pass a style object to override or customize component's style

About

A component that displays a banner when it detects no or low connectivity.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published