Make the swap widget yours.
Pick a preset or your own colors, choose which tokens people can swap, then copy the code. The preview on the right is the real widget, so quotes and wallets work exactly as they will on your site.
PresetLayerHop
A preset sets every color for dark and light. Colors you pick below override it.
Colorsdefault theme
AaButton contrast 15.1:1, passes WCAG AA. Focus rings adapt to stay visible.
TypographyDefault
Scales the whole card, 87.5% to 112.5%.
Layout480px wide
ContentSwap
An https image, shown next to the title at 24 × 24 px.
Shown once the swap is ready to review.
Tokens and chainsUSDC to USDC
In whole tokens, for example 100 or 0.5.
For deposits: funds land at this address on the receive chain.
Allow-lists
Limit what each side offers. Empty means everything.
BehaviourEverything shown
Empty uses Auto, which picks a tolerance per pair.
English for now; more languages will use this same setting.
Lets that page change the amount, tokens and colors with postMessage.
PartnerNot set
Registered partners earn their own fee on every swap.
Events from the preview
Waiting for the widget…
<iframe
id="layerhop-widget"
src="https://layerhop.com/embed?srcChain=base&srcToken=USDC&dstChain=arbitrum&dstToken=USDC&amount=100"
title="LayerHop swap"
allow="clipboard-write"
style="display:block;width:100%;max-width:480px;height:640px;border:0;background:transparent;color-scheme:normal"
></iframe>
<script>
// Fit the iframe to its content. Only trust messages from LayerHop.
window.addEventListener("message", (event) => {
if (event.origin !== "https://layerhop.com" || event.data?.source !== "layerhop") return;
if (event.data.type === "resize") {
document.getElementById("layerhop-widget").style.height = event.data.payload.height + "px";
}
});
</script>The widget runs on LayerHop, so wallets connect there and your page never handles keys.