Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Migrate from RainbowKit

txKit is a UI kit + transaction layer; RainbowKit is wallet-first. Many dApps will keep RainbowKit (or another wallet kit) AND adopt txKit alongside via embedded mode. If you want to fully replace RainbowKit, this guide covers it.

Recommended path: hybrid. Keep RainbowKit for wallet UX and add <TransactionButton /> + <FlowSteps /> from txKit for tx-flow safety. Skip to "Hybrid Mode" below.

Architecture Shift

RainbowKittxKit
<RainbowKitProvider><TxKitProvider> (or embedded)
<ConnectButton /><ConnectWallet />
useAccount (wagmi)useWalletState()
<TransactionStatus /> (custom)<TransactionButton /> + <FlowSteps />

Step-by-Step Replacement

1. Replace the Provider

Before (RainbowKit):

import { RainbowKitProvider, getDefaultConfig } from '@rainbow-me/rainbowkit'
import { WagmiProvider } from 'wagmi'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { mainnet } from 'viem/chains'
 
const config = getDefaultConfig({
  appName: 'My App',
  projectId: 'WC_PROJECT_ID',
  chains: [ mainnet ],
})
const queryClient = new QueryClient()
 
const App = ({ children }) => (
  <WagmiProvider config={config}>
    <QueryClientProvider client={queryClient}>
      <RainbowKitProvider>{children}</RainbowKitProvider>
    </QueryClientProvider>
  </WagmiProvider>
)

After (txKit standalone):

import { TxKitProvider } from '@txkit/react'
import { mainnet } from 'viem/chains'
import { http } from 'viem'
 
const App = ({ children }) => (
  <TxKitProvider config={{
    chains: [ mainnet ],
    transports: { [mainnet.id]: http() },
    walletConnectProjectId: 'WC_PROJECT_ID',
  }}>
    {children}
  </TxKitProvider>
)

2. Replace the Connect Button

Before:

import { ConnectButton } from '@rainbow-me/rainbowkit'
const Header = () => <ConnectButton />

After:

import { ConnectWallet } from '@txkit/react'
const Header = () => <ConnectWallet />

Prop mapping:

RainbowKit <ConnectButton> proptxKit <ConnectWallet> equivalent
accountStatus="full"(default - full status shown)
chainStatus="full"(default)
showBalanceshowBalance (same name)
label="Connect"label="Connect" (same name)
theme={midnightTheme}wrap in <div className="tx-root tx-dark">

3. Add Transaction Flow Components

RainbowKit doesn't ship a transaction-status component; teams build their own. txKit ships <TransactionButton /> + compound <FlowSteps /> / <FlowProgress /> / <FlowToast />.

import { TransactionButton, FlowSteps, FlowToast, txStep } from '@txkit/react'
import { parseEther } from 'viem'
 
const SendButton = () => (
  <>
    <TransactionButton steps={[ txStep('send', 'Send', { to: '0x...', value: parseEther('0.01') }) ]} />
    <FlowSteps />
    <FlowToast />
  </>
)

4. Theme Mapping

RainbowKit theme proptxKit equivalent
theme={midnightTheme}<div className="tx-root tx-dark"> parent class
theme.colors.accentColor--tx-color-primary CSS variable
theme.radii.connectButtonvariant="rounded" on <TxKitProvider>
theme.fonts.body--tx-font-family CSS variable

See Theming for the full token reference.

Feature Parity

FeatureRainbowKittxKit v0.1.0-alpha
Wallet connect modalyesyes (<ConnectWallet />)
ENS name + avataryesyes
Chain switching promptyesyes
WalletConnect QRyesyes
Recent walletsyesyes
Custom theme tokensyes (theme object)yes (CSS vars)
Transaction simulationnoyes
Multi-step flow primitivesnoyes
Risk scoring slotnoyes
MAX_UINT256 approval warningnoyes

For features beyond v0.1.0-alpha (like custom wallet onboarding flows), keep RainbowKit and use Hybrid Mode.

Hybrid Mode (Recommended)

Don't rip out RainbowKit. Use embedded mode and add <TransactionButton /> + compound components for tx-flow safety:

import { TxKitProvider } from '@txkit/react'
import { RainbowKitProvider } from '@rainbow-me/rainbowkit'
 
const App = ({ children }) => (
  <WagmiProvider config={config}>
    <QueryClientProvider client={queryClient}>
      <RainbowKitProvider>
        <TxKitProvider embedded>
          {children}
        </TxKitProvider>
      </RainbowKitProvider>
    </QueryClientProvider>
  </WagmiProvider>
)

See the Embedded Mode guide for AppKit/ConnectKit/Privy/Dynamic patterns.

Troubleshooting

  • "useChainModal is not defined" -> RainbowKit-specific hook; use useTxKit().config.chains to read available chains, or useSwitchChain() from wagmi directly.
  • "My theme tokens don't apply" -> ensure .tx-root class is on a parent element. <TxKitProvider> adds it automatically; manual <div className="tx-root"> needed only when scoping inside a non-Provider tree.
  • "Connect modal doesn't show my wallet" -> set walletConnectProjectId in <TxKitProvider config>. Without it, only injected wallets appear.