I have a webapp with a list of items.
The items can be viewed in grid view (tiles) or in a vertical list.
At the top, I have a toolbar of sorts that have two icons that the user can toggle between the grid and the list views (only icons no labels)
In mobile this takes too much space in the top bar and we need to reduce the space taken by such 2-state toggling buttons.
I though maybe having one button that toggles between the two states but than found this: Should a toggle button show its current state or the state to which it will change?
What is best practice for this scenario if there is one?
Addition:
Also, is it a good practice to hide such buttons in mobile so that the user has to click a menu button to show these options which on desktop are always visible?