Render the Nexus Widget and understand how props and callbacks work.
You have installed the component and configured the NexusProvider. Now it is time to render a working widget. In this guide you will add Nexus Widget to a page, understand each prop it accepts, and handle its lifecycle callbacks.
What you will build
By the end of this page you will have a fully functional swap-and-bridge widget embedded in your app. The user will be able to select a source and receive asset across chains and execute the intent — all with built-in progress UI, fee breakdowns, and error handling. Switching to send or deposit is a one-line config.mode change.
Interactive Configurator
You can generate the exact basic config for your desired widget mode live using the Widget Configurator .
Step 1 — Install the package
If you have not already installed the package during the installation step, install it now:
pnpmadd@avail-project/widgets
Step 2 — Create a page
Create a new page (or add to an existing one) that renders NexusWidget. Here is a complete example:
Wallet address to use. If omitted, the connected wagmi account is used.
embed
boolean
No
Defaults to true. Set false to render as a modal surface, controlled with open, onOpenChange, and defaultOpen.
onComplete
(explorerUrl?: string) => void
No
Called after a successful swap, send, or deposit. Use it to refresh balances or navigate.
onStart
() => void
No
Called when the user starts execution. Useful for analytics.
onError
(message: string) => void
No
Called if execution fails, with a human-readable message.
onClose
() => void
No
Used by modal mode. The close button is hidden in embedded mode.
onConnectClick
() => void | Promise<void>
No
Called when the widget's internal Connect Wallet CTA is clicked. Use it to open your app's wallet modal.
config.mode is the only always-required field
Beyond config.mode, every field is optional unless the selected mode makes it conditional (deposit requires destination, depositAddress, and executeDeposit). See the Swap and Bridge, Send, and Deposit pages for each mode's configuration reference.
Step 4 — Run and test
Start your development server and navigate to the page:
pnpmdev
Open your app in the browser
Connect a wallet using your wallet connection UI
The widget should appear with USDC on Base pre-selected as the receive asset
Try selecting a different token or chain to verify the form is interactive
Mainnet only
Nexus Widget currently supports mainnet only. Testnet is not supported at the moment.
Switching modes
The same component powers send and deposit — just change config.mode. To render a send flow instead: