react-dsfr icon indicating copy to clipboard operation
react-dsfr copied to clipboard

Allow tabs to be disabled

Open pierrelemee opened this issue 7 months ago β€’ 2 comments

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.

pierrelemee avatar Jul 03 '25 07:07 pierrelemee

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!

ddecrulle avatar Jul 03 '25 08:07 ddecrulle

@iNeoO went faster πŸš€ merci !

pierrelemee avatar Jul 11 '25 12:07 pierrelemee

Closing this issue at it seems done.

enguerranws avatar Dec 16 '25 11:12 enguerranws