bumbag-ui
bumbag-ui copied to clipboard
Support Controlled Tabs
Is your feature request related to a problem? Please describe. I need to know which tab is active, so I can do something(fetch data for instance) when tab is in active state
Describe the solution you'd like If tabs support the controlled state, I guess I can use the selectedId to know which tab is active
Describe alternatives you've considered
- provide context store that I can get selectedId and use it to know which tab is active
- provide a hook that returns whether tabId is active or not
Hey, sorry about the late reply. Ideally, it would be nice to create a pattern like Tabs.State
or Tabs.useState
just like we do for our Modals so you can choose to control the state. I'll need to add this in. I think it would also be nice to add a prop to defer mounting of a tab panel until the tab is clicked too, which may be a nicer solution to fetch data for a particular tab.
Thanks!! those will be very helpful features!!