Bridge
Swap widget
The Swap widget makes it easy to add cross-chain token swaps to your app using the thirdweb SDK.


- Cross-chain token swaps across 50+ blockchains
- Real-time quotes with up-to-date pricing
- Route optimization to find the best path for any token pair
- Customizable UI - use prebuilt themes or override with your brand colors
- Prefill token selections for a smoother user experience
- Event callbacks to track user actions (success, error, cancel)
You will need a thirdweb project client id to use the SwapWidget component. You can get your clientId by creating a project in the thirdweb dashboard.
Make sure to wrap the component containing SwapWidget with the ThirdwebProvider component.
By default, no tokens are selected in the widget UI. You can configure the default token selection by passing in the prefill prop. It only sets the default token selection - users can change these selections in the widget UI.
To configure a native token to sell by default, you can omit the tokenAddress property.
SwapWidget Component
View the API reference for the SwapWidget component
Swap Widget Playground
Try out the Swap Widget in our live playground