The below screenshot shows an example where clicking on the buttons "Squares" or "Circles" shows or hides the respective objects.