# Connect Wallet

> An animated connect-wallet dialog for React and shadcn, from provider list to a connected account pill.

A connect-wallet flow on Base UI Dialog: provider list, then connecting with a spinner badge, then the account avatar flies out of the dialog into the header pill. Declined requests say so with Try again; the pill reopens the account view with copy and Disconnect.

- Tier: Eased Pro
- Interaction: Press
- Page: https://eased.dev/components/connect-wallet
- Installs: motion

## Install

Connect Wallet ships with Eased Pro (https://eased.dev/#pricing). Members add the `@eased-pro` registry with their token (https://eased.dev/account), then run:

```bash
npx shadcn add @eased-pro/connect-wallet
```

A connect-wallet flow on Base UI Dialog: provider list, connecting, connected, then the account avatar flies into a header pill.

## When to use

- The sign-in button of any dapp or exchange.
- When the connected state should live in the header and reopen an account view.

## When not to use

- Email or OAuth sign-in: use a form in a Dialog.
- Showing balances: use Wallet Card once connected.

## Usage

```tsx example.tsx
import { ConnectWallet } from "@/components/eased/connect-wallet/connect-wallet";

<ConnectWallet
  providers={[{ id: "injected", name: "Browser wallet", detail: "Detected" }]}
  connect={async (id) => {
    const address = await yourConnector(id);
    return { address, name: await lookupEns(address) };
  }}
/>
```

## API reference

### ConnectWallet

| Prop | Type | Default | Description |
|---|---|---|---|
| `providers` | `WalletProvider[]` | | `{ id, name, detail?, icon? }`. |
| `connect` | `(id) => Promise<WalletAccount>` | | Resolve `{ address, name? }`, or reject when declined. |
| `account` / `onAccountChange` | `WalletAccount \| null` | | Controlled account; uncontrolled when omitted. |
| `container` | `HTMLElement \| null` | `document.body` | Dialog portal target. |
| `label` | `string` | `"Connect wallet"` | Trigger label. |

## Keyboard

| Key | Action |
|---|---|
| `Tab` | Through providers, Cancel, Try again, Disconnect. |
| `Enter` / `Space` | Choose. |
| `Escape` | Closes the dialog and cancels a pending request. |

## Accessibility

- Base UI's Dialog traps focus and returns it to the trigger. The status view is a polite live region ("Opening Browser wallet…", "Connected", "Request declined").
- The pill is named "Wallet: mara.eth".

## Motion

Views inside the dialog swap with a 6px rise and a 2px blur on the smooth spring. Connecting shows a spinner badge on the provider tile; on success the tile becomes the account avatar with a check, holds 650ms, then the dialog closes and the avatar flies into the header pill as a shared-layout element on the smooth spring. Reduced motion: cross-fades only, no flight.

## Notes for AI

Pick it for wallet sign-in. Wrap your connector (wagmi, a wallet SDK) in `connect`; it handles states, retry, cancel and the header pill.

Don't add your own spinner or toast for connecting, and don't render a second header avatar: the pill is the connected state. To keep the modal inside a preview frame, give the frame `contain: layout` and pass it as `container`.

## Related

- [Wallet Card](/components/wallet-card): what to show once connected.
- [Dialog](/components/dialog): the surface it uses.
