> For the complete documentation index, see [llms.txt](/llms.txt)

# useWalletConnection

React hook to manage wallet connection status and information in a Sui dApp.



The `useWalletConnection` hook provides access to the current wallet connection status and
information.

<Callout type="warn">
  All dApp Kit hooks must be used within components that are descendants of
  [`DAppKitProvider`](../dapp-kit-provider). Using them outside will result in an error.
</Callout>

## Usage

```tsx
import { useWalletConnection } from '@mysten/dapp-kit-react';

export function MyComponent() {
	const connection = useWalletConnection();

	if (connection.status === 'disconnected') {
		return <div>Please connect your wallet</div>;
	}

	if (connection.status === 'connecting') {
		return <div>Connecting...</div>;
	}

	// status === 'connected'
	return (
		<div>
			<p>Connected to: {connection.wallet.name}</p>
			<p>Address: {connection.account.address}</p>
		</div>
	);
}
```

## Return value

```tsx
{
	status: 'disconnected' | 'connecting' | 'reconnecting' | 'connected';
	wallet: UiWallet | null;
	account: UiWalletAccount | null;
	supportedIntents: string[];
	isConnected: boolean;
	isConnecting: boolean;
	isReconnecting: boolean;
	isDisconnected: boolean;
}
```
