Before we start extending off our base button with our different styles, let’s first add interactivity so it’s not just a basic HTML button.
Event Propagation
First, let’s add x-data
to the parent div of our button within our demonstration page. This will bind AlpineJS to the element, enabling Alpine state, events, etc. Meaning, we can also add a click handler to it.