JSFiddle - React, Tailwind, and code Playground

HTML

<div id="host">hello</div>
<input>

CSS

*:focus {background: green;}
*:focus-visible {color: red;}

JavaScript

host.attachShadow({mode: 'open'}).innerHTML = '<slot></slot><input>world';