JSFiddle - React, Tailwind, and code Playground

JavaScript

const host = document.createElement('div');
const shadowRoot = host.attachShadow({mode: 'closed'});
shadowRoot.innerHTML = `<slot name="active">hi</slot>
<slot name="inactive" hidden>hello</slot>`;
document.body.appendChild(host);