useNetworkInformation

Hook

Returns network connection details via the Network Information API. Tracks online status, connection type, downlink speed, and RTT. Falls back gracefully.

core/use-network-information

Installation

1 · Add registry to components.json

2 · Install component

Examples

Connection info

Live network type, downlink, and RTT.

API Reference

PropTypeDescription
(returns) isOnline
booleanWhether the device is online.
(returns) networkInfo
NetworkInformation | nullConnection type, downlink, RTT (where supported).
(returns) isSupported
booleanWhether the Network Information API is available.
(returns) refresh
() => voidForce a refresh of the network state.