useNetwork
Real-time network connection monitor providing online/offline state and bandwidth.
1.6 KB
•Updated on September 3, 2026
Installation
Bash
pnpm dlx shadcn@latest add @spaceui/hooks-browser-use-networkUsage
Code
import { useNetwork } from '@/hooks/use-network'
const { isOnline, downlink, effectiveType } = useNetwork()API Reference
Parameters / Props
None
Return Value
| Property | Type | Description |
|---|---|---|
isOnline | boolean | Internet connection state. |
downlink | number|undefined | Bandwidth in Mbps. |
effectiveType | string|undefined | Connection tier. |