Wallet Modal Customization Guide

1. Basic Usage

The simplest way to use the wallet modal is to use the default TitanKitModal:

import { TitanKitModal, TitanKitProvider } from '@titan-kit/react';

function App() {
  return (
    <TitanKitProvider
      chains={_chains}
      wallets={_wallets}
      assetLists={_assetLists}
      walletModal={TitanKitModal}  // Use default modal
    >
      <YourApp />
    </TitanKitProvider>
  );
}

2. Custom Modal Component

You can create your own modal component using shadcn/ui components:

3. Modal Props

The custom modal component should accept these props from WalletModalProps:

4. Using Modal Hook

The useWalletModal hook provides access to wallet functionality:

5. Advanced Custom Modal Example

6. Best Practices

  1. Modal Design

    • Use shadcn/ui components for consistent design

    • Follow Tailwind CSS best practices

    • Implement responsive design

    • Handle loading and error states

  2. Wallet Integration

    • Support all provided wallets

    • Handle connection errors gracefully

    • Show connection status

    • Provide clear disconnect option

  3. User Experience

    • Make wallet selection intuitive

    • Show wallet logos and names clearly

    • Provide helpful error messages

    • Allow easy modal closing

7. Common Issues

  1. Modal Visibility

    • Ensure proper isOpen state management

    • Handle onOpenChange properly

    • Check z-index conflicts

  2. Wallet Connection

    • Handle connection errors

    • Show loading states

    • Validate wallet availability

  3. Styling Issues

    • Use Tailwind CSS classes effectively

    • Maintain consistent spacing

    • Handle dark/light mode

    • Ensure proper component composition