Customization
WheelX Widget supports both functional configuration and visual customization.
If you want the fastest workflow, start from the hosted theme page:
Recommended workflow:
Open the theme page
Adjust colors and typography
Copy the generated config
Paste it into your host app
Add functional restrictions such as networks or tokens
π§© Configuration Overview
The main config type is:
import type { WheelxWidgetConfig } from '@wheelx/widget'Example:
const widgetConfig: WheelxWidgetConfig = {
mode: 'bridge-and-swap',
referralCode: 'your-affiliate-code',
networks: {
from: [1, 8453],
to: [8453, 137]
},
defaultTokens: {
from: {
chainId: 8453,
address: '0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2',
symbol: 'USDT'
},
to: {
chainId: 8453,
address: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
symbol: 'USDC'
}
},
allowedTokens: {
from: [
{
chainId: 8453,
tokens: ['0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2']
}
]
},
styles: {
formContainer: {
backgroundColor: '#0f172a'
}
}
}π mode
Controls the widget flow.
Supported values:
bridge-and-swapEnables swap, bridge, and cross-chain routing.swapRestricts the widget to same-chain swap flows.
Example:
Use swap when:
your product only supports a single chain
you want a simpler UI
you do not want users switching into bridge routes
πΈ referralCode
Adds your affiliate code to widget quote requests.
Good to know:
the value is trimmed before use
the widget does not need a separate UI change for referral tracking
the same config can be combined with theme and token restrictions
You can get your code here:
π networks
Restricts which chains users can choose.
Supported forms:
'all'a single chain ID
an array of chain IDs
Examples:
Allow only Base:
Allow bridge from Ethereum or Base into Base or Polygon:
Use this when:
your app only supports a known list of chains
you want to avoid irrelevant routes
you want a smaller, more guided selection flow
πͺ defaultTokens
Sets the initial token selection shown in the widget.
Recommended usage:
prefill the most common trading pair
match the primary network of your product
reduce the number of clicks before the user gets a quote
Notes:
chainIdandaddressare the real identifierssymbolis optional, but helpful for readabilityif a default token is not valid under the current restrictions, the widget falls back to the nearest valid option
π allowedTokens
Restricts the selectable tokens on a per-chain basis.
This is especially useful when:
your product should only expose approved assets
you want to guide users into a narrow route set
you are embedding the widget for a single token onboarding path
Behavior notes:
restrictions are chain-scoped
addresses are normalized internally
chains not listed remain unrestricted
ποΈ styles
Use styles to override the widget appearance with slot-based style objects.
Style Areas
The widget supports a broad set of visual slots. In practice, the most useful groups are:
Form shell
formContainer,formTitleText,formFooterTextToken and input area
sectionContainer,tokenSelector,amountInputContainer,amountInputTextButtons
primaryButton,primaryButtonText,quickHalfButton,quickMaxButtonToken modal
tokenModalContent,tokenModalSearchInput,tokenModalChainPanel,tokenModalTokenPanelSlippage controls
slippageSettingsTrigger,slippagePopoverContent,slippageAutoButton,slippageCustomInputQuote and transaction status
quoteInfoContainer,quoteInfoCard,txStateCard,txStatePrimaryButton
Example: Branded Dark Theme
Last updated