Multi-chain Swap

Cross-chain swap widget with chain + token selectors, morphing views, animated flip and quote.

Preview

Swap

≈ $3,142

1.245· Ethereum
18.702381

≈ $3,142

12.4· Solana
Rate1 ETH18.702381 SOLNetwork fee$0.42Slippage0.50%ETA≈ 24s

Install

Add it with the shadcn CLI, or copy the source manually.

$ bunx --bun shadcn add @beui/swap

API Reference

chains?
{}
[ { id: "eth", name: "Ethereum", tone: "bg-primary text-primary-foreground", symbol: "Ξ" }, { id: "sol", name: "Solana", tone: "bg-secondary text-secondary-foreground", symbol: "◎" }, { id: "base", name: "Base", tone: "bg-accent text-accent-foreground", symbol: "B" }, { id: "arb", name: "Arbitrum", tone: "bg-muted text-muted-foreground", symbol: "A" }, { id: "op", name: "Optimism", tone: "bg-destructive text-primary-foreground", symbol: "O" }, { id: "poly", name: "Polygon", tone: "bg-primary/80 text-primary-foreground", symbol: "P" }, { id: "bnb", name: "BNB", tone: "bg-secondary text-secondary-foreground", symbol: "B" }, { id: "avax", name: "Avalanche", tone: "bg-destructive/80 text-primary-foreground", symbol: "A" }, ]
tokens?
{}
[ { id: "eth-eth", symbol: "ETH", name: "Ether", chainId: "eth", balance: 1.245, usd: 3142, popular: true, }, { id: "eth-weth", symbol: "WETH", name: "Wrapped Ether", chainId: "eth", balance: 0.5, usd: 3142, popular: true, }, { id: "eth-usdc", symbol: "USDC", name: "USD Coin", chainId: "eth", balance: 4521, usd: 1, popular: true, }, { id: "eth-usdt", symbol: "USDT", name: "Tether", chainId: "eth", balance: 2100, usd: 1, popular: true, }, { id: "eth-dai", symbol: "DAI", name: "Dai Stablecoin", chainId: "eth", balance: 800, usd: 1, popular: true, }, { id: "eth-wbtc", symbol: "WBTC", name: "Wrapped Bitcoin", chainId: "eth", balance: 0.04, usd: 96000, popular: true, }, { id: "eth-link", symbol: "LINK", name: "ChainLink Token", chainId: "eth", balance: 120, usd: 22, address: "0x51...86ca", trending: true, }, { id: "eth-aztec", symbol: "AZTEC", name: "AZTEC", chainId: "eth", balance: 0, address: "0xa2...62d2", trending: true, }, { id: "eth-cfg", symbol: "CFG", name: "Centrifuge", chainId: "eth", balance: 0, address: "0xcc...8a94", trending: true, }, { id: "eth-ondo", symbol: "ONDO", name: "Ondo", chainId: "eth", balance: 0, address: "0xfa...9be3", trending: true, }, { id: "sol-sol", symbol: "SOL", name: "Solana", chainId: "sol", balance: 12.4, usd: 168, }, { id: "sol-usdc", symbol: "USDC", name: "USD Coin", chainId: "sol", balance: 985.32, usd: 1, }, { id: "base-eth", symbol: "ETH", name: "Ether", chainId: "base", balance: 0.65, usd: 3142, }, { id: "base-usdc", symbol: "USDC", name: "USD Coin", chainId: "base", balance: 1200, usd: 1, }, { id: "arb-arb", symbol: "ARB", name: "Arbitrum", chainId: "arb", balance: 800, usd: 0.95, }, { id: "arb-eth", symbol: "ETH", name: "Ether", chainId: "arb", balance: 0.32, usd: 3142, }, { id: "op-op", symbol: "OP", name: "Optimism", chainId: "op", balance: 450, usd: 2.8, }, { id: "poly-matic", symbol: "MATIC", name: "Polygon", chainId: "poly", balance: 1500, usd: 0.75, }, { id: "bnb-bnb", symbol: "BNB", name: "BNB", chainId: "bnb", balance: 0, usd: 620, }, { id: "avax-avax", symbol: "AVAX", name: "Avalanche", chainId: "avax", balance: 0, usd: 38, }, ]
defaultFromId?
string
eth-eth
defaultToId?
string
sol-sol
className?
string

Keep in mind

Some components on this site are inspired by or recreated from existing work across the web. I'm not here to take credit; just to learn, experiment, and sometimes push things a bit further. If something looks familiar and I forgot to mention you, reach out and I'll fix that right away.

Updated