You just need to put the buttons next to eachother and set them to collapse when not visible based on the condition you want. When one isnt visible the other is and will take its place in the parent group