Shared React

mountly — three widgets, one React

Three widget instances, but only one copy of React is downloaded. Check the Network tab — you'll see a single react@18 request, not three.

How it works: the import map above points each widget at its /peer.js build instead of /index.js. Peer builds leave react and react-dom/client as external specifiers, which the browser resolves via the same import map. Swap the entries back to /index.js and remove the React entries to go back to self-contained widgets.

Widget 1 — Payment breakdown

Default-themed payment popover.

Widget 2 — Payment breakdown, retuned palette

Same widget code, different tokens. The host sets --ui-accent on the mount element.

Widget 3 — Image lightbox

A different widget entirely, dark aesthetic.