Widget
Widget Variants
The OpenOcean Widget V2 supports multiple variants to fit different use cases.
Key Features
- Unified cross-chain & same-chain swaps
- Supports 40+ chains and any token pair
- Customizable UI to match your branding
- Built-in OpenOcean swap routing for best price execution
Available Variants
default
Standard widget layout with full features.
compact
Smaller footprint for tight spaces.
split
Separate input and output token sections.
Subvariants
bridge
Enable cross-chain functionality for bridging assets.
Terminal
JS
1 subvariant: "bridge" // Enable cross-chain swaps
split
Split view for separate input/output panels.
Terminal
JS
1 subvariant: "split" // Split view layout
Example Configuration
Terminal
JS
1 const widgetConfig = { 2 variant: "compact", 3 subvariant: "bridge", // Enable cross-chain functionality 4 appearance: "dark", 5 theme: { 6 container: { 7 border: '1px solid rgb(234, 234, 234)', 8 borderRadius: '16px', 9 }, 10 }, 11 } 12
13 <OpenOceanWidget integrator="your-app" config={widgetConfig} />
Use Cases
- dApps: Allow users to swap and bring assets cross-chain to your protocol
- DeFAI: Boost your AI agent's execution capabilities with optimized routing
- DeFi tools: Add a seamless token entry point with best-rate execution
- GameFi/Meme/Launchpad: Enable users to fund wallets across chains without leaving your site