Remove a previous rendered catalog from the DOM
Parameters
el
:HTMLElement
The DOM node that the catalog was rendered into
Returns
void
unmountCatalog
removes a previously rendered catalog from the DOM. This is most useful in a Javascript-enabled page where the user has navigated away from the catalog.
<html>
<head>
<script src="https://<your-slug>.xkit.co/xkit-catalog.js"></script>
// ... assumes jQuery
</head>
<body>
<div id="my-special-node"></div>
<button id="remove-catalog">Remove catalog</button>
<script>
$(() => {
xkit.renderCatalog($("#my-special-node").get(0), {
title: "My Integrations"
})
$("#remove-catalog").click(() => {
xkit.unmountCatalog($("#my-special-node").get(0))
})
})
</body>
</html>
Configuration
Configuring renderCatalogDefault
is done by adding data-
attributes to the #xkit-app
HTML tag (or other ID you specified) you used to render the catalog.
For example, if you wanted to configure the token
property, you would add a data-token
attribute:
<div id="xkit-app" data-token="some-user-token"></div>
See Configuring xkit-catalog.js for a full list of available configurations