> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sorokit.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# useNetworkStatus

> Monitor the health and ledger state of the Stellar network.

The `useNetworkStatus` hook provides real-time information about the RPC node and the current state of the blockchain. It is designed to power network indicators or "Status Dots" in your application.

#### Features

* Combined Results: Returns both the RPC health status and the latest ledger sequence in a single call.
* Auto-Polling: Refetches data every 30 seconds by default to ensure the information is current.
* Global State: Since it uses a shared query key, the network status is synchronized across all components in your app.

#### Usage

```tsx theme={null}
import { useNetworkStatus } from "@sorokit/hooks";

function ConnectionStatus() {
  const { data } = useNetworkStatus();

  const isHealthy = data?.health.status === "healthy";
  const ledger = data?.latestLedger.sequence;

  return (
    <div>
      <span className={isHealthy ? "bg-green-500" : "bg-red-500"} />
      <span>{isHealthy ? "Connected" : "Service Disruption"}</span>
      {ledger && <p>Latest Ledger: {ledger}</p>}
    </div>
  );
}
```
