Skip to main content
SwapWidget is the inline swap/bridge form. Same-chain swaps and cross-chain bridges share this UI; the widget quotes both when source and destination chains differ. It must render inside DZapWidgetProvider.

Props

SwapToken:
Pass identity-only defaults. The widget loads the connected wallet’s balance. Do not stamp balances onto defaultSrcToken.
Build a SwapToken from the public token list with tokenToSwapToken. See Data helpers.

Drawer trigger

SwapButton opens the same form in a drawer. It accepts every SwapWidget prop plus trigger styling.
Imperative control via ref (WidgetDrawerRef): open(), close(), toggle(), isOpen().

Imperative form API

SwapWidget also exposes a ref (SwapWidgetRef):

Connect button

ConnectWalletButton is the multi-chain connect/disconnect control. It uses @dzapio/wallet under the hood. If hiddenUI.walletMenu is set, it renders nothing. useAccount is re-exported from @dzapio/widget so you can read the connected account without installing the wallet package. See Wallet hooks.
Last modified on August 18, 2026