pre><code class="lang-javascript">// define a component
var ExampleComponent = {
    view: function(vnode) {
        return m(&quot;div&quot;, vnode.attrs, [&quot;Hello &quot;, vnode.children])
    }
}

// consume it
m(ExampleComponent, {style: &quot;color:red;&quot;}, &quot;world&quot;)

// equivalent HTML:
// &lt;div style=&quot;color:red;&quot;&gt;Hello world&lt;/div&gt;
</code></pre>
<hr>
<h3 id="structure"><a href="#structure">Structure</a></h3>
<p>Virtual DOM nodes, or <em>vnodes</em>, are Javascript 