Skip to main content

Display Options

OptionTypeDefaultDescription
containerIdstringrequiredDOM element ID to mount into
partnerIdstringYour partner ID for fee tracking
theme"dark" | "light""dark"Widget color theme
mode"swap" | "gas" | "fund""swap"Initial active mode
modesstring"swap,gas,fund"Comma-separated list of enabled modes
widthstring"420px"Widget width
heightstring"700px"Widget height
hideOnrampbooleanfalseHide the mode toggle (swap/gas/fund)
hidePoweredBybooleanfalseHide “Powered by Hypermid”

Mode Control

You can control which modes are available in the widget using the modes parameter:
// Show only Swap and Buy Crypto (hide Gas)
HypermidWidget.init({
  containerId: "hypermid-widget",
  modes: "swap,fund",
  mode: "swap",
});
// Show only Swap (no mode toggle shown)
HypermidWidget.init({
  containerId: "hypermid-widget",
  modes: "swap",
});
When only one mode is enabled, the mode toggle is automatically hidden.

Chain & Token Presets

OptionTypeDefaultDescription
defaultFromChainnumber | string1Default source chain — numeric ID or slug
defaultToChainnumber | stringDefault destination chain — numeric ID or slug
defaultFromTokenstringDefault source token address
defaultToTokenstringDefault destination token address
defaultFromAmountstringDefault input amount
destAddressstringPre-fill destination/recipient address (overrides connected wallet)
walletAddressstringPre-fill wallet address
lockFromChainbooleanfalseLock source chain selector
lockToChainbooleanfalseLock destination chain selector
The destAddress parameter is useful when the destination address differs from the connected wallet — for example, when building a payment flow where users send tokens to a merchant address, or when the recipient is a smart contract.

Chain Identifiers

Hypermid uses a unified chain ID system. You can reference chains by either their numeric ID or a human-readable slug:
ChainSlugChain ID
Ethereumethereum1
Arbitrumarbitrum42161
Basebase8453
Polygonpolygon137
Optimismoptimism10
PulseChainpulsechain369
BNB Chainbsc56
Avalancheavalanche43114
Berachainberachain80094
Solanasolana1151111081099710
Bitcoinbitcoin20000000000001
Suisui9270000000000000
NEARnear900000001
TONton900000002
Trontron900000003
XRPxrp900000004
Dogecoindoge900000005
Aptosaptos900000010
zkSync Erazksync324
Linealinea59144
Scrollscroll534352
Sonicsonic146
Mantlemantle5000
Blastblast81457
Use slugs for non-EVM chains"solana" is much easier to work with than 1151111081099710. EVM chains can use either format: defaultFromChain: 1 or defaultFromChain: "ethereum".
For the complete list of all 90+ supported chains, use the Chains API endpoint or the Preset Builder. Example — ETH to USDC on Arbitrum (using slugs):
HypermidWidget.init({
  containerId: "hypermid-widget",
  defaultFromChain: "ethereum",
  defaultToChain: "arbitrum",
  defaultFromToken: "0x0000000000000000000000000000000000000000", // ETH
  defaultToToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",  // USDC
  lockFromChain: true,
  lockToChain: true,
});
Example — Solana to Bitcoin (non-EVM slugs):
HypermidWidget.init({
  containerId: "hypermid-widget",
  defaultFromChain: "solana",
  defaultToChain: "bitcoin",
});

Theme Customization

Override any visual aspect of the widget to match your brand:
OptionTypeDefaultDescription
accentColorstring"#44E1AA"Accent & highlight color
buttonColorstringCTA button color (overrides gradient)
accentHoverColorstringAccent hover state color
bgCardstring"#0C1022"Card background color
bgCardInnerstring"#0E1428"Inner card / token area background
bgInputstring"#111832"Input field background
textPrimarystring"#E2E8F0"Primary text color
textSecondarystring"#8A9AB4"Secondary text color
borderColorstringBorder color (format: "hex:opacity" e.g. "6C63FF:15")
borderRadiusnumber16Card corner radius in px
buttonRadiusnumber12Button corner radius in px
fontFamilystring"Sora"Google Font family name

Border Color Format

The borderColor option uses a special hex:opacity format where opacity is a percentage (0–100):
// Blue border at 10% opacity
borderColor: "416EF2:10"

// Purple border at 15% opacity
borderColor: "6C63FF:15"

// Simple solid hex (100% opacity)
borderColor: "333333"

Font Family

Any Google Font is supported. The widget dynamically loads the font when specified. Popular choices: Sora (default), Inter, Poppins, Space Grotesk, DM Sans, Roboto, Manrope, Outfit, Plus Jakarta Sans, Nunito Sans, Work Sans, Montserrat, Rubik, Figtree, Lexend

Full Branding Example

HypermidWidget.init({
  containerId: "swap",
  partnerId: "trust-wallet",
  theme: "dark",
  defaultFromChain: 1,
  defaultToChain: 42161,
  // Brand customization
  accentColor: "#FF6B35",
  buttonColor: "#FF6B35",
  bgCard: "#252540",
  bgCardInner: "#2D2D55",
  bgInput: "#35356A",
  textPrimary: "#FFFFFF",
  textSecondary: "#A0A0C0",
  borderColor: "FF6B35:12",
  borderRadius: 20,
  buttonRadius: 8,
  fontFamily: "Inter",
});

Direct Iframe URL Parameters

When using the direct iframe embed, pass theme options as URL query parameters (hex values without #):
https://www.hypermid.io/widget?embed=1
  &theme=dark
  &accent=FF6B35
  &buttonColor=FF6B35
  &bgCard=252540
  &borderRadius=20
  &buttonRadius=8
  &fontFamily=Inter
  &destAddress=0x1234...abcd
Use the Widget Playground to visually configure all these options and generate the embed code automatically.