Swiping thru tabs/slides and adding active slide

Hi, I am trying to build a page with Carousel/Slider in my hero section. At the top of this component I would like to have tabs to switch between slides. But I would also like to swipe between slides. Is there any way to make it like that: When I click on tab it should switch the slide(depends on the tab), and swipe thru slides and I would also like to store active slide in a variable. Does that make sense?

Any solution you found here? I’m trying to do the same thing to achieve sliding sub-navigation on mobile, but want to preserve tab-based navigation. It seems to depend on exposing the active slide and binding it to a variable.