Connect Wallet

PreviousNext

A button and dialog to connect a wallet, with an optional prompt component.

Documentation

Installation

pnpm dlx shadcn@latest add @wallet-kit/connect

Usage

ConnectWallet

The main button component that opens a dialog to select a wallet. When a wallet is connected, it displays the wallet icon and ellipsified address with a disconnect button.

import { ConnectWallet } from "@/components/wallet/connect"
 
export default function Demo() {
  return <ConnectWallet />
}

ConnectWalletPrompt

A prompt component that displays a warning message when no wallet is connected. It automatically hides when a wallet is connected.

Wallet not connected

Please connect your wallet to continue.

import { ConnectWalletPrompt } from "@/components/wallet/connect"
 
export default function Demo() {
  return (
    <ConnectWalletPrompt />
  )
}

API Reference

ConnectWallet

A button that opens a dialog to select a wallet. If a wallet is already connected, it displays the connected wallet's address and a disconnect button.

Props

PropTypeDefaultDescription
variantstring"default"The button variant style (default, outline, ghost, etc.).
classNamestring-Additional CSS classes.
childrenReactNode"Connect Wallet"Custom button text.

Inherits all props from shadcn/ui Button.

Behavior

  • Not Connected: Shows a button that opens a dialog with the list of available wallets
  • Connected: Shows a ButtonGroup with the wallet icon, ellipsified address, and a disconnect button
  • Dialog: Contains a toggle to show wallet onboarding information

ConnectWalletPrompt

A prompt component that displays when no wallet is connected. Useful for gating content that requires wallet connection.

Props

PropTypeDefaultDescription
variantstring"outline"The Item variant style.
classNamestring-Additional CSS classes.

Inherits all props from shadcn/ui Item.

Behavior

  • Not Connected: Displays an alert-style item with a warning icon, message, and a ConnectWallet button
  • Connected: Renders null (automatically hidden)

Examples

Basic Connection

import { ConnectWallet } from "@/components/wallet/connect"
 
export default function Header() {
  return (
    <header>
      <ConnectWallet />
    </header>
  )
}

With Custom Text

import { ConnectWallet } from "@/components/wallet/connect"
 
export default function Demo() {
  return (
    <ConnectWallet variant="outline">
      Connect Your Wallet
    </ConnectWallet>
  )
}

Using the Prompt

import { ConnectWalletPrompt } from "@/components/wallet/connect"
 
export default function ProtectedContent() {
  return (
    <div>
      <ConnectWalletPrompt />
      {/* Your protected content here */}
    </div>
  )
}
  • The component automatically handles wallet connection state
  • When connected, the disconnect button uses the same variant as the main button
  • The dialog includes an info button that toggles wallet onboarding information
  • The component uses WalletList internally to display available wallets

Last updated 11/21/2025