Integrations
Third-party scripts
Swap an app's icons from a script it didn't bundle.
The registry is one instance per page, however many copies of the package are loaded. A script added to the page can import it and change the icons the app already renders.
<script type="module" src="/app.js"></script>
<script type="module" src="https://publisher.example.com/icons.js"></script>
// icons.js
import { register, override, use } from 'https://esm.sh/@munsonlabs/sigil'
// replace individual icons
override({
IconLock: '<svg …>',
IconSave: '<svg …>',
})
// or a whole set
register(
'brand',
{
className: 'brand',
mapping: { IconLock: 'brand-lock' },
},
{ default: true },
)
Everything on the page re-renders as each call lands.
Loading…
Document the icon names your app renders and the variant values it passes; those are what a publisher targets. Overrides always win, so a publisher can replace any single icon, and nothing they register can undo an app-level override.