Bringing Everything Together: Handling Button Clicks

The implementation of a button dispatching an onClick action

In the last lesson, we covered all but one aspect of the ButtonGroup implementation: the data-tech attribute. This is called a data attribute, which exists for each button.

It is a way to store some extra information that doesn’t have any visual representation. It makes it slightly easier to grab certain values off of an element.

A completely rendered button will look like this:

Get hands-on with 1200+ tech skills courses.