The BridgeWidget Script makes it easy to embed cross-chain swaps and fiat onramp UI into your app. Just add a script tag to your HTML and get a fully customizable widget — no build setup required.
Key Features
Cross-chain token swaps across 80+ blockchains
Fiat onramp support to buy tokens with credit/debit cards
Customizable UI - use prebuilt themes or override with your brand colors
Prefill token selections for a smoother user experience
Display fiat values in multiple currencies
Event callbacks to track user actions (success, error, cancel, disconnect)
Set the default token amount shown in the "Buy" tab.
Specify which chain should be selected in the "Buy" tab.
Specify which token should be selected in the "Buy" tab. If not specified, the native token of the selected chain will be selected.
Override the label for main action button
Pass a callback to be called when the user cancels the purchase.
Pass a callback to be called when the user encounters an error during the purchase.
Pass a callback to be called when the user successfully completes the purchase.
Apply a custom class name to the "Buy" tab content container.
The user's ISO 3166 alpha-2 country code. This is used to determine onramp provider support.
Preset fiat amounts to display in the UI. Defaults to [5, 10, 20].
theme
Set the theme for the widget. You can either set it to "dark", "light" or overrides some or all the colors by passing an object. By default it set to "dark".
When overriding the colors, you must set the type to either "dark" or "light" so that the widget knows which theme to apply the overrides to.
typeTheme=
|"dark"
|"light"
| {
type:"dark"|"light"; // required
accentButtonBg?:string;
accentButtonText?:string;
accentText?:string;
borderColor?:string;
connectedButtonBg?:string;
connectedButtonBgHover?:string;
danger?:string;
inputAutofillBg?:string;
modalBg?:string;
modalOverlayBg?:string;
primaryButtonBg?:string;
primaryButtonText?:string;
primaryText?:string;
scrollbarBg?:string;
secondaryButtonBg?:string;
secondaryButtonHoverBg?:string;
secondaryButtonText?:string;
secondaryIconColor?:string;
secondaryIconHoverBg?:string;
secondaryIconHoverColor?:string;
secondaryText?:string;
selectedTextBg?:string;
selectedTextColor:string;
separatorLine?:string;
skeletonBg:string;
success?:string;
tertiaryBg?:string;
tooltipBg?:string;
tooltipText?:string;
};
Example
BridgeWidget.render(container, {
clientId: "your-thirdweb-client-id",
theme: {
type: "dark",
colors: {
modalBg: "black",
primaryText: "white",
},
},
});
currency
The token amounts fiat values will be displayed in this currency. By default, it is set to "USD".
typeCurrency=
|"USD"
|"EUR"
|"GBP"
|"JPY"
|"KRW"
|"CNY"
|"INR"
|"NOK"
|"SEK"
|"CHF"
|"AUD"
|"CAD"
|"NZD"
|"MXN"
|"BRL"
|"CLP"
|"CZK"
|"DKK"
|"HKD"
|"HUF"
|"IDR"
|"ILS"
|"ISK";
showThirdwebBranding
Whether to show thirdweb branding at the bottom of the widget. By default, it is set to true.