Styling Widget
Customizing the Swapper Finance Deposit Widget Appearance
Customizing the Widget's Appearance
Overview of the Styling System
How to Apply Styles
// SDK-based example (no manual URL building)
import { SwapperIframe } from '@swapper-finance/deposit-sdk';
const yourIntegratorId = 'xxxx'; // Your actual integrator ID
const swapper = new SwapperIframe({
container: '#swapperFinanceWidget', // or pass an HTMLElement
integratorId: yourIntegratorId,
// Required deposit params:
dstChainId: '8453', // Destination chain ID (example: Base)
dstTokenAddr: '0x...', // Destination token address (ERC-20)
depositWalletAddress: '0x...', // Wallet receiving deposits
// Styling (same structure as before)
styles: {
themeMode: 'dark',
componentStyles: {
primaryColor: '#FF6B35',
primaryBorderColor: '#FF6B35',
accentColor: '#FF6B35',
primaryTextColor: "#FFFFFF"
}
},
});
// Optionally update styles later
// swapper.updateStyles({ themeMode: 'light' });Style Configuration Object (SwapperStyles)
SwapperStyles)Customization Levels & Examples
1. Theme Mode
2. Component Styles
Style Application Hierarchy
Color Validation
Last updated