o 0.</p>
<pre><code class="lang-css">.exit {animation:fade-out 0.5s;}
@keyframes fade-out {
    from {opacity:1;}
    to {opacity:0;}
}
</code></pre>
<p>Now let&#39;s create a contrived component that shows and hides the <code>FancyComponent</code> we created in the previous section:</p>
<pre><code class="lang-javascript">var on = true

var Toggler = {
    view: function() {
        return [
            m(&quot;button&quot;, {onclick: function() {on = !on}}, &quot;Toggle&quot;),
            on ? m(FancyComp