Allow tabs to be disabled
Allow tabs to be disabled
Sometimes it can be useful to disable a tab, thus indicating the user that the tab content is not available at the moment.
I figured there could be a way to declare tabs, either in controlled and uncontrolled modes, as such:
<Tabs
selectedTabId={selectedTabId}
tabs={[
{ tabId: "me", label: "About me" },
{ tabId: "results", label: "My results", disabled: true }
]}
onTabChange={selectTabId}
/>
I don't know why the disabled attribute is not available yet, maybe there is a reason I'm not aware of.
In case of acceptance, I'm π to contribute.
Hi,
Thanks for pointing this out!
Youβre absolutely right β being able to disable a tab can be very useful, whether in controlled or uncontrolled mode. I'm not aware of a strong reason why this hasn't been implemented yet, so your proposal sounds reasonable.
Feel free to open a pull request β weβd be happy to review it!
@iNeoO went faster π merci !
Closing this issue at it seems done.