I&#x27;m a huge fan of Clojure&#x27;s Hiccup library.  It allows the user to make html like the following.<p>Here&#x27;s a function that always returns true - but it could do any kind of data access. It is just plain Clojure.<p><pre><code>    (defn selected? [] true)
</code></pre>
Here is a datastructure that represents html:<p><pre><code>    [:h2 {:class (when (selected?) &quot;selected&quot;)} &quot;Hello&quot;]
</code></pre>
Calling the function hiccup.core&#x2F;html on that datastructure yeilds an html string like this:<p><pre><code>    &quot;&lt;h2 class=&#x27;selected&#x27;&gt;Hello&lt;&#x2F;h2&gt;&quot;
</code></pre>
So that&#x27;s great for _strings_ right?  But there is an awesome library for ClojureScript called Reagent. And it uses those simple datastructures to generate react components!!  I put some more examples at: <a href="http:&#x2F;&#x2F;hiccup.space" rel="nofollow">http:&#x2F;&#x2F;hiccup.space</a>