Network Indicator
On this page
Network Indicator
Persistently displays a user's current network name based on a given network ID. You can optionally display an icon and tooltip to tell the user if they're on the correct network for the dapp.
Built with Rimble-UI
Installation
Install the package in your project directory with:
// with npmnpm install @rimble/network-indicator// with yarnyarn add @rimble/network-indicator
Usage Example
Default
Current NetworkRopsten
Has requiredNetwork prop
Current NetworkNone
Custom tooltips for default
Current NetworkMain
Custom tooltips with requiredNetwork prop
Current NetworkNone
Props
children
shape
(optional)
Default value:
{ onNetworkMessage: null, noNetworkMessage: null, onRequiredNetworkMessage: null, onWrongNetworkMessage: null, }
currentNetwork
number
(optional)
Default value:
null
requiredNetwork
number
(optional)
Default value:
null
Default Messages
onNetworkMessage
Only when requiredNetwork
exists and matches currentNetwork
prop
You're on the right network
noNetworkMessage
You're not on an Ethereum network
onWrongNetworkMessage
You're on the wrong network