Is it good to add a toggle switch on a navbar. I need to switch between the 2 contents in a page by a toggle-switch. If not suggest me a good way to toggle the content
Can you explain it a bit more? maybe a screenshot would help.
However, I would not suggest to use a toggle on the main navigation to switch content. The basic idea of a toggle button is to show enable/disable or rather on/off states. So this might confuse your users. Why don't you use 2 links instead? You could make them prominent by using a primary colour which goes with your branding.
Instead of a toggle switch, a tabbed navigation might be more suitable. consider the example of navigation clothes, the tab on top would separate men and womens clothes.