There is a widget for that: Tab switcher https://marketplace.mendix.com/link/component/265
Regards,
Ronald
Other option is my Tab Switcher widget, has some more use cases. On the forum you can find many implementations including how to's:
https://forum.mendix.com/link/questions/94614
https://forum.mendix.com/link/questions/94715
https://forum.mendix.com/link/questions/106342