useNetworkInformation
HookReturns network connection details via the Network Information API. Tracks online status, connection type, downlink speed, and RTT. Falls back gracefully.
core/use-network-informationInstallation
1 · Add registry to components.json
2 · Install component
Examples
Connection info
Live network type, downlink, and RTT.
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
(returns) isOnline | boolean | — | Whether the device is online. |
(returns) networkInfo | NetworkInformation | null | — | Connection type, downlink, RTT (where supported). |
(returns) isSupported | boolean | — | Whether the Network Information API is available. |
(returns) refresh | () => void | — | Force a refresh of the network state. |