Skip to content
wyllet
  • Docs
  • Features
  • Playground
  • Blog
  • Docs
  • Features
  • Playground
  • Blog
  • Compare
  • Changelog
GitHub @wylletdevnpm Support
esc
  • IntroductionWhat Wyllet is, what it includes, and how it fits into a wagmi + viem dApp.
  • InstallationInstall Wyllet and its peer dependencies, and enable WalletConnect.
  • Quick startAdd a working connect button to a React dApp in a few minutes.
  • Next.jsUse Wyllet with the Next.js App Router, server components and SSR.
  • Build with AI assistantsGive Cursor, Claude Code, Copilot or ChatGPT the Wyllet docs and the rules for a correct integration.
  • ConfigurationCreate a wagmi config with getDefaultConfig: app info, chains, transports and wallets.
  • WylletProviderEvery WylletProvider prop: theme, appearance, tokens, auth, messages and callbacks.
  • WylletButtonThe Island button, its display options, and building your own trigger with useWylletButton.
Overview

Getting started

  • Introduction
  • Installation
  • Quick start
  • Next.js
  • Build with AI assistants

Core concepts

  • Configuration
  • WylletProvider
  • WylletButton
  • Presentations

Customization

  • Theming
  • Class names
  • Translations

Wallets

  • Wallets
  • All wallets
  • WalletConnect

Chains and tokens

  • Chains
  • Tokens

Features

  • Account panel
  • Activity and transactions
  • Toasts
  • Sign-In With Ethereum
  • ConnectGate

Reference

  • Hooks
  • Components
  • Utilities and types

Guides

  • Security
  • Migrate from RainbowKit
  • FAQ
wyllet

The open-source wallet connector for React dApps. Built on wagmi and viem.

MIT licensed. v1.1.0 on npm with provenance.

Product

  • Features
  • Compare
  • Playground
  • Changelog
  • Blog

Docs

  • Quick start
  • Next.js
  • Build with AI
  • Theming
  • Migrate from RainbowKit

Community

  • GitHub
  • X @wylletdev
  • npm
  • Releases
  • Report an issue

Support

  • support@wyllet.dev
  • FAQ
  • Security
  • Report a vulnerability
  • MIT License

For AI agents

  • llms.txt
  • llms-full.txt
  • RSS feed
  • Sitemap

Wallet, network and token names and logos are trademarks of their respective owners and are used only to identify them.

Docs/Core concepts

WylletProvider

Every WylletProvider prop: theme, appearance, tokens, auth, messages and callbacks.

View .mdReport a problem

<WylletProvider> holds Wyllet's options and renders the panel and toasts. Place it inside <WagmiProvider> and <QueryClientProvider>, and render every Wyllet component and hook inside it.

Usage

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import type { ReactNode } from 'react'
import { WagmiProvider } from 'wagmi'
import { obsidianTheme, WylletProvider } from 'wyllet'
import { config } from './wagmi'
 
const queryClient = new QueryClient()
 
export function Providers({ children }: { children: ReactNode }) {
  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        <WylletProvider
          theme={obsidianTheme({ accentColor: '#C6F432' })}
          appearance={{ presentation: 'popover' }}
          shortcut="mod+k"
        >
          {children}
        </WylletProvider>
      </QueryClientProvider>
    </WagmiProvider>
  )
}

Every prop is optional except children. Wyllet components and hooks throw an error if they are rendered outside the provider.

Props

PropTypeDefaultDescription
childrenReactNodeRequiredYour app.
themeTheme | { light: Theme; dark: Theme }Porcelain (light) and Obsidian (dark)A single theme, or a light and dark pair. See Theming.
colorMode'auto' | 'light' | 'dark''auto'Which half of a theme pair to use. auto follows the OS. Ignored for a single theme.
appearanceAppearanceSee belowPresentation and behavior options.
appInfoPartial<AppInfo>From getDefaultConfig()Overrides app details. Merged over the registered values.
walletsWallet[]From getDefaultConfig(), else defaultWallets()Overrides the wallet list. Needed with a hand-written wagmi config.
walletConnectProjectIdstringFrom getDefaultConfig()WalletConnect project ID for hand-written configs. Enables the All wallets directory.
tokensTokenList | TokenEntry[] | 'default' | false'default'Tokens in the Tokens tab, for every user. 'default' is a built-in list of blue chips, false shows the native balance only. See Tokens.
chainOrdernumber[][]Chain ids shown first in the Networks tab, in this order. The rest follow in config order.
allowTokenImportbooleanfalseLets users add ERC-20 tokens by contract address. Saved in their browser.
shortcutstringNoneKeyboard shortcut that toggles the panel, such as 'mod+k'.
messagesPartial<Messages>EnglishRename or translate any string. See Translations.
classNamesPartial<Record<WylletSlot, string>>{}Extra classes per element. See Class names.
chainIconsRecord<number, string>{}Icon URL per chain id. Takes priority over customChain() icons and built-in marks.
avatarComponentType<CustomAvatarProps>Gradient avatarReplaces the generated avatar everywhere.
authWylletAuthAdapterNoneEnables Sign-In With Ethereum. See SIWE.
disclaimerReactNodeTerms noticeCustom footer content in the connect panel. Replaces the terms notice.
ensbooleantrueResolve ENS names and avatars. Only takes effect when mainnet is in your config.
injectStylesbooleantrueInject the base stylesheet. Set false and import wyllet/styles.css yourself.
onConnect(info) => voidNoneCalled after a connection. See Callbacks.
onDisconnect() => voidNoneCalled after the wallet disconnects.

Appearance

appearance groups the options that change how the panel looks and behaves. Pass only the keys you want to change; the rest keep their defaults.

<WylletProvider
  appearance={{
    presentation: 'popover',
    identityCard: true,
    accountTabs: ['tokens', 'activity'],
    toastPosition: 'bottom-right',
  }}
>
OptionTypeDefaultDescription
presentation'drawer' | 'popover' | 'modal''drawer'How the panel enters the screen. See Presentations.
drawerSide'left' | 'right''right'Side the drawer slides in from.
mobileSheetbooleantrueUse a draggable bottom sheet on screens up to 640px wide, whatever the presentation.
identityCardbooleanfalseShow a generative holographic card, unique to each address, instead of the compact account summary.
cardTiltbooleantrue3D tilt and light sheen that follow the pointer on the identity card.
accountTabsAccountTab[]['tokens', 'activity', 'networks']Tabs in the account panel, in order.
closeOnConnectbooleantrueClose the panel after a successful connection. With false, it moves on to the account panel.
tokenSort'balance' | 'list''balance'balance: pinned tokens, then tokens the user holds, then the rest, each group in list order. list: pinned first, then exactly your list order.
walletSearchboolean | 'auto''auto'Search field in the wallet list. auto shows it when there are 6 or more wallets.
walletDirectorybooleantrueThe All wallets directory from the WalletConnect registry. Also needs a WalletConnect project ID.
toastPositionToastPosition'top-center''top-left', 'top-center', 'top-right', 'bottom-left', 'bottom-center' or 'bottom-right'.
brandingbooleantrueThe "Powered by Wyllet" badge in the panel footers.
disableAnimationsbooleanfalseTurn off all transitions. prefers-reduced-motion is respected either way.

App info

appInfo accepts any subset of these fields. Values you pass are merged over the ones getDefaultConfig() registered from appName, appDescription, appUrl and appIcon.

FieldTypeDescription
namestringShown in the connect panel title. Falls back to "this app" when nothing is set.
descriptionstringApp description.
urlstringApp URL.
iconstringSquare icon URL.
learnMoreUrlstringTarget of the "Learn more about wallets" link. Defaults to ethereum.org's wallet page.
termsUrlstringTerms of service URL.
privacyUrlstringPrivacy policy URL.

The connect panel footer shows "By connecting you accept the Terms and Privacy Policy" only when both termsUrl and privacyUrl are set. A disclaimer replaces that notice entirely.

Keyboard shortcut

shortcut is a +-separated combination. The modifiers are mod, ctrl, meta, shift and alt, and the last part is the key. mod means ⌘ on macOS and Ctrl elsewhere.

<WylletProvider shortcut="mod+k">

The shortcut toggles the panel. It opens the account view when the user is connected (and signed in, if you use SIWE), and the connect view otherwise. While disconnected, <WylletButton> shows the shortcut as a hint.

Custom avatar

avatar receives the address, the resolved ENS avatar URL (when there is one) and the size in pixels.

import type { CustomAvatarProps } from 'wyllet'
 
function MyAvatar({ address, ensImage, size }: CustomAvatarProps) {
  return <img src={ensImage ?? `/avatars/${address}.png`} width={size} height={size} alt="" />
}
 
<WylletProvider avatar={MyAvatar}>

Callbacks

onConnect runs after each connection, including automatic reconnects on page load. Use isReconnected to tell them apart.

<WylletProvider
  onConnect={({ address, chainId, connectorId, isReconnected }) => {
    if (!isReconnected) analytics.track('wallet_connected', { connectorId, chainId })
  }}
  onDisconnect={() => analytics.track('wallet_disconnected')}
>
FieldTypeDescription
addressAddressThe connected account.
chainIdnumberThe connected chain.
connectorIdstringThe wagmi connector id.
isReconnectedbooleantrue when the session was restored rather than newly connected.

Related

  • Configuration
  • Presentations
  • Theming
  • Hooks
PreviousConfigurationNextWylletButton

On this page

  • Usage
  • Props
  • Appearance
  • App info
  • Keyboard shortcut
  • Custom avatar
  • Callbacks
  • Related