Ready to get started?

Join Adocasts Plus, on sale now for $4/mo, or sign into an existing Adocasts Plus account, to get access to all of our lessons.

robot mascot smiling

EdgeJS Components #3.1

Adding Interactivity to our Button

In This Lesson

We'll add extendable interactivity to our button using AlpineJS. We'll also walk through a demonstration of how we can utilize event propagation in AlpineJS to our advantage.

Created by
@tomgobich
Published

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.

Join the Discussion 0 comments

Create a free account to join in on the discussion
robot comment bubble

Be the first to comment!