Custom button in navbar

Hello ,
i want to make a custom switch button in navbar to hide/unhide some elements
i know how to hide the elements but i don’t know how to make the button
thanks