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

# useCurrentWallet

React hook to get the currently connected wallet in a Sui dApp.



The `useCurrentWallet` hook provides access to the currently connected wallet.

<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 { useCurrentWallet } from '@mysten/dapp-kit-react';

export function MyComponent() {
	const wallet = useCurrentWallet();

	if (!wallet) {
		return <div>No wallet connected</div>;
	}

	return (
		<div>
			<p>Wallet: {wallet.name}</p>
			<p>
				Icon: <img src={wallet.icon} alt={wallet.name} />
			</p>
			<p>Accounts: {wallet.accounts.length}</p>
		</div>
	);
}
```

## Return value

```tsx
UiWallet | null;
```
