Buttons are an essential UI component in every application. In this recipe, we'll create a toggle button, which will be unselected by default. When the user taps on it, we'll change the styles applied to the button to make it appear selected.
We'll learn how to detect the tap event, use an image as the UI, keep the state of the button, and add styles based on the component state.