
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
interop-widget
Advanced tools
A React widget for cross-chain asset bridging with customizable themes, default route configuration, and advanced UI components.
npm install interop-widget
import { InteropWidget } from 'interop-widget';
import 'interop-widget/style.css';
// Use with default theme
<InteropWidget />
// Use with custom theme
<InteropWidget theme={customTheme} />
// Use with default route configuration
<InteropWidget defaultRouteConfig={routeConfig} />
// Use with both theme and route config
<InteropWidget
theme={customTheme}
defaultRouteConfig={routeConfig}
/>
This widget uses Tailwind CSS v3 with the iw- prefix to prevent conflicts with host applications. All widget styles are prefixed with iw- to ensure complete isolation.
iw-import { InteropWidget } from 'interop-widget';
import 'interop-widget/style.css';
<InteropWidget />
Instead of standard Tailwind classes, the widget uses prefixed classes:
mx-auto → iw-mx-autoflex → iw-flexp-4 → iw-p-4text-center → iw-text-centerYou can pre-configure the widget with default source and destination chains and tokens:
import { InteropWidget } from 'interop-widget';
const defaultRouteConfig = {
fromChain: 'BNB Chain',
fromToken: 'BTCB',
toChain: 'Base',
toToken: 'CBBTC'
};
<InteropWidget defaultRouteConfig={defaultRouteConfig} />
The widget currently supports BSC and Base chains with their respective Bitcoin tokens. See the Configuration Guide for the complete list.
The widget includes a powerful tooltip component that renders outside parent containers to avoid overflow issues:
import { Tooltip } from 'interop-widget';
<Tooltip content="This is a tooltip" direction="top">
<button>Hover me</button>
</Tooltip>
Features:
import { Modal } from 'interop-widget';
<Modal isOpen={isModalOpen} onClose={() => setIsModalOpen(false)}>
<h2>Modal Content</h2>
<p>This is a modal dialog.</p>
</Modal>
The widget includes a global toast notification system that can be used throughout your application:
import { useToast } from 'interop-widget';
function MyComponent() {
const { success, error, warning, info } = useToast();
const handleSuccess = () => {
success('Transaction Complete!', 'Your swap was successful');
};
const handleError = () => {
error('Transaction Failed', 'Insufficient balance');
};
const handleWarning = () => {
warning('Low Balance', 'Consider adding more funds');
};
const handleInfo = () => {
info('Processing', 'Your transaction is being processed');
};
return (
<div>
<button onClick={handleSuccess}>Success Toast</button>
<button onClick={handleError}>Error Toast</button>
<button onClick={handleWarning}>Warning Toast</button>
<button onClick={handleInfo}>Info Toast</button>
</div>
);
}
import { useToast } from 'interop-widget';
function AdvancedComponent() {
const { addToast, removeToast, clearAllToasts } = useToast();
const showCustomToast = () => {
const toastId = addToast({
title: 'Custom Toast',
description: 'This is a custom toast with transaction hash',
status: 'success',
duration: 10000, // 10 seconds
hash: '0x123...abc', // Transaction hash
chain: chainInfo // Chain info for explorer link
});
// Manually remove after 5 seconds
setTimeout(() => removeToast(toastId), 5000);
};
return (
<div>
<button onClick={showCustomToast}>Custom Toast</button>
<button onClick={clearAllToasts}>Clear All Toasts</button>
</div>
);
}
For advanced use cases, you can still use the Toast component directly:
import { Toast } from 'interop-widget';
function ManualToast() {
const [showToast, setShowToast] = useState(false);
return (
<>
<button onClick={() => setShowToast(true)}>Show Toast</button>
<Toast
isOpen={showToast}
onClose={() => setShowToast(false)}
title="Manual Toast"
description="This requires manual state management"
status="info"
/>
</>
);
}
The theme object has a simple structure:
interface Theme {
color: {
'primary-bg': string;
'secondary-bg': string;
'ternary-bg': string;
'text-primary': string;
'text-secondary': string;
'text-tertiary': string;
};
}
const defaultTheme = {
color: {
'primary-bg': '#ffffff',
'secondary-bg': '#f8f9fa',
'ternary-bg': '#e9ecef',
'text-primary': '#212529',
'text-secondary': '#6c757d',
'text-tertiary': '#adb5bd',
},
};
const darkTheme = {
color: {
'primary-bg': '#1a1a1a',
'secondary-bg': '#2d2d2d',
'ternary-bg': '#404040',
'text-primary': '#ffffff',
'text-secondary': '#b3b3b3',
'text-tertiary': '#808080',
},
};
<InteropWidget theme={darkTheme} />
const lightTheme = {
color: {
'primary-bg': '#ffffff',
'secondary-bg': '#f8f9fa',
'ternary-bg': '#e9ecef',
'text-primary': '#212529',
'text-secondary': '#6c757d',
'text-tertiary': '#adb5bd',
},
};
<InteropWidget theme={lightTheme} />
const partialTheme = {
color: {
'primary-bg': '#ff0000', // Only change primary background
},
};
<InteropWidget theme={partialTheme} />
Currently, the widget supports the following chains:
Base Chain:
CBBTC - Core Bitcoin (Contract: 0xcbb7c0000ab88b473b1f5afd9ef808440eed33bf)BNB Chain:
BTCB - Bitcoin BEP2 (Contract: 0x7130d2A12B9BCbFAe4f2634d864A1Ee1Ce3Ead9c)Sepolia Base:
CBBTC - Core Bitcoin (Contract: 0xfaeec4E06C3D0439d2ac55473b4a45758031f86B)BEVM:
WBTC - Wrapped Bitcoin (Contract: 0xff204e2681a6fa0e2c3fade68a1b28fb90e4fc5f)The widget enforces type-safe chain-token combinations:
type ChainTokenMapping = {
"Sepolia Base": "CBBTC";
"BEVM": "WBTC";
"Base": "CBBTC";
"BNB Chain": "BTCB";
};
| Prop | Type | Default | Description |
|---|---|---|---|
theme | Partial<Theme> | defaultTheme | Custom theme object |
defaultRouteConfig | DefaultRouteConfig | undefined | Pre-configured route |
network | 'mainnet' | 'testnet' | 'mainnet' | Network environment |
interface DefaultRouteConfig {
fromChain: ChainName;
fromToken: TokenName;
toChain: ChainName;
toToken: TokenName;
}
FAQs
reusable React widget component
We found that interop-widget demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.