Skip to content

Components

Wallet Button

One button for the whole wallet lifecycle. Connect, restore, account.

The wallet button most apps need in their header. It shows “Connect wallet” when disconnected and the Account button when connected. While wagmi restores a previous connection on page load, it shows a placeholder, so returning users never see a flash of “Connect wallet”.

Restoring wallet connection
Terminal window
npx shadcn@latest add @0xui/wallet-button
import { WalletButton } from "@/components/wallet-button";
<WalletButton />;

Pass props through to either state:

<WalletButton
connect={{ title: "Sign in", onConnect: track }}
account={{ showBalance: true }}
/>
Phase What the user sees
restoring Skeleton the size of the button: during server render and while wagmi reconnects.
disconnected Connect Wallet button.
connected Account button.

useWalletButtonPhase() returns the current phase.

Prop Type Description
connect ConnectWalletProps Props for the connect button and picker.
account AccountProps Props for the account button and panel.
className string Applied in every state.