Rainbow logo


Get up and running with RainbowKit


Install RainbowKit and its peer dependencies, wagmi and ethers.

npm install @rainbow-me/rainbowkit wagmi ethers

Note: RainbowKit is a React library.


Import RainbowKit, wagmi, and ethers.

import '@rainbow-me/rainbowkit/styles.css';
import { apiProvider, configureChains, getDefaultWallets, RainbowKitProvider, } from '@rainbow-me/rainbowkit';
import { chain, createClient, WagmiProvider } from 'wagmi';


Configure your wallets, desired chains and generate the required connectors. You will also need to setup a wagmi client.

import { chain, createClient, WagmiProvider } from 'wagmi';
const { chains, provider } = configureChains(
[chain.mainnet, chain.polygon, chain.optimism, chain.arbitrum],
const { connectors } = getDefaultWallets({
appName: 'My RainbowKit App',
const wagmiClient = createClient({
autoConnect: true,

Wrap providers

Wrap your application with RainbowKitProvider and WagmiProvider.

const App = () => {
return (
<WagmiProvider client={wagmiClient}>
<RainbowKitProvider chains={chains}>
<YourApp />

Add the connect button

Then, in your app, import and render the ConnectButton component.

import { ConnectButton } from '@rainbow-me/rainbowkit';
export const YourApp = () => {
return <ConnectButton />;

You're done! RainbowKit will now handle your user's wallet selection, display wallet/transaction information and handle network/wallet switching.

Note: If you're using Remix, remember to add RainbowKit to its server dependencies.

Add your own functionality

Now that your users can connect their wallets, you can start building out the rest of your app using wagmi.

Send transactions, interact with contracts, resolve ENS details and much more with wagmi’s comprehensive suite of React Hooks.

For more detail, view the wagmi documentation.

Further examples

To see some running examples of RainbowKit, or even use them to automatically scaffold a new project, check out the official rainbowkit-examples repository.

To try RainbowKit directly in your browser, check out the CodeSandbox links below: