What is it?

binder.js is a JavaScript library to help you build custom web components to use in your server rendered templates!


Show me!

click counter

Clicks: {this.data.clicks}

View Source
<click-counter>
    <p @render>Clicks: {this.data.clicks}</p>
    <button @click="this.count()">Click me!</button>
</click-counter>

<script type="module">
    import { registerControllers, Controller } from '/static/js/binder/binder.js';

    class ClickCounter extends Controller {
        init() {
            this.data.clicks = 0;
        }

        count() {
            this.data.clicks++;
            this.render();
        }
    }

    registerControllers(ClickCounter);
</script>


Interested?

You can get started now by checking out the quick start instructions or learn more from our guide.