Open eirikbacker opened 1 week ago
Lets investigate and make a POC PR we can look at.
Aside from finding in #2355 it would be good to document other benefits or lack of support in the current implementation.
Quick example (not implemented controlled state): #2494
Pros:
value=""
on every panel and every tabCons:
<Tabs>
<Tabs.List>
<Tabs.Tab aria-selected="true">Tab 1</Tabs.Tab> // We can indeed change this to `<Tabs.Tab selected>` if we want
<Tabs.Tab>Tab 2</Tabs.Tab>
<Tabs.Tab>Tab 3</Tabs.Tab>
</Tabs.List>
<Tabs.Panel>Panel 1</Tabs.Panel>
<Tabs.Panel hidden>Panel 2</Tabs.Panel>
<Tabs.Panel hidden>Panel 3</Tabs.Panel>
</Tabs>
This would ensure good accessibility, provide a go-to-option for non-React-users, as well as remove the need for manually setting
value
on all tabs subcomponents