component by defining attributes and children, as shown in the example below.</p>
<pre><code class=language-javascript>// define a component
var Greeter = {
    view: function(vnode) {
        return m(&quot;div&quot;, vnode.attrs, [&quot;Hello &quot;, vnode.children])
    }
}

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

// renders to this HTML:
// &lt;div style=&quot;color:red;&quot;&gt;Hello world&lt;/div&gt;</code></pre>
<p>To learn more about components, <a href=compone