JSFiddle - React, Tailwind, and code Playground
HTML
<div>
foo
<div id=host></div>
</div>
CSS
div {
border: 2px solid green;
margin: 5px;
padding: 2px;
}
JavaScript
const host = document.getElementById('host');
const shadowRoot = host.attachShadow({mode:'open'});
shadowRoot.innerHTML = '<div>bar</div>'
document.designMode = 'on';