Alpine.bind(...) provides a way to re-use x-bind objects within your application.

Here's a simple example. Rather than binding attributes manually with Alpine:

<button type="button" @click="doSomething()" :disabled="shouldDisable"></button>

You can bundle these attributes up into a reusable object and use x-bind to bind to that:

<button x-bind="SomeButton"></button>
document.addEventListener('alpine:init', () => {
Alpine.bind('SomeButton', () => ({
type: 'button',
'@click'() {
':disabled'() {
return this.shouldDisable

Code highlighting provided by Torchlight