Widget Light (Documentation Index
Fetch the complete documentation index at: https://docs.li.fi/llms.txt
Use this file to discover all available pages before exploring further.
@lifi/widget-light) lets you embed the full LI.FI cross-chain swap and bridge widget into your application via an iframe, while keeping wallet connections on your side. Users sign transactions with their existing wallet ā the widget never touches browser extensions or private keys directly.
When to Use Widget Light vs the Full Widget
Widget Light (@lifi/widget-light) | Full Widget (@lifi/widget) | |
|---|---|---|
| Rendering | Runs inside an iframe hosted at widget.li.fi | Renders directly in your React tree |
| Dependencies | Zero core dependencies beyond React | MUI, Zustand, TanStack Router, i18next, and more |
| Bundle size | Minimal ā only the postMessage bridge ships in your bundle | Full widget code is included in your bundle |
| Wallet ownership | Your app owns all wallet connections | Widget manages wallets via provider packages |
| Isolation | Sandboxed iframe ā widget cannot access your DOM or state | Shares your React context and DOM |
| Configuration | JSON-serializable config only (no React nodes, no MUI themes) | Full WidgetConfig with React nodes, callbacks, and MUI theming |
| Framework support | Any framework that can render an iframe | React 18+ only |
Architecture
- Your app renders
<LiFiWidgetLight>which loads the hosted widget URL in an iframe - The iframe sends a
READYsignal; your app responds with configuration and wallet state - When the widget needs a signature or chain switch, it sends an RPC request via
postMessage - Your ecosystem handler (e.g. wagmi for EVM) executes the request and returns the result
- Wallet state changes (account switch, network change) are pushed to the iframe automatically
https://widget.li.fi by default) for security.
Key Benefits
- Iframe isolation ā the widget runs in a sandboxed iframe; your page stays in full control
- Zero core dependencies ā
@lifi/widget-lightships nothing beyond React as a peer dependency; chain-specific handlers are tree-shakeable subpath imports - Your wallet, your UX ā transactions are signed by wallets you already manage (wagmi, wallet-standard, bigmi, dapp-kit)
- Reactive configuration ā update config at any time without reloading the iframe
- Typed event system ā subscribe to route execution, wallet, and UI events with full TypeScript support
Supported Ecosystems
Widget Light supports five blockchain ecosystems, each through a dedicated handler hook:| Ecosystem | Chain Type | Handler | Import Path |
|---|---|---|---|
| Ethereum (EVM) | EVM | useEthereumIframeHandler() | @lifi/widget-light/ethereum |
| Solana | SVM | useSolanaIframeHandler() | @lifi/widget-light/solana |
| Bitcoin | UTXO | useBitcoinIframeHandler() | @lifi/widget-light/bitcoin |
| Sui | MVM | useSuiIframeHandler() | @lifi/widget-light/sui |
| Tron | TVM | useTronIframeHandler() | @lifi/widget-light/tron |
Hosted Widget
The widget iframe loads fromhttps://widget.li.fi by default. You do not need to host or deploy any widget code yourself ā the <LiFiWidgetLight> component points to this URL automatically.
For testing against a specific version or a self-hosted deployment, pass your custom URL as the src prop.
Next Steps
- Install Widget Light ā set up the package and dependencies
- Configure Widget Light ā learn about all configuration options
- Widget Light Events ā subscribe to widget events
- Widget Light Wallet Management ā understand ecosystem handlers
- Widget Light API Reference ā full component and hook reference

