Small util to load Swingby's swap widget in your app.
Quick start
Installation
yarn add @swingby-protocol/widget @swingby-protocol/sdk
Examples
import { createWidget, openPopup } from '@swingby-protocol/widget';
const widget = createWidget({ mode: 'test', variant: 'big' });
openPopup(widget);
import { createWidget, getHtml } from '@swingby-protocol/widget';
const widget = createWidget({ mode: 'test', variant: 'banner' });
document.querySelector('#my-container').innerHTML = getHtml(widget);
Widget sizes
⚠️ Note that both the widget and this util use rem
units.
Banner | 76px |
Small | 375px |
Big | 510px |