Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use u-tabs under the hood of Tabs? #2449

Open
eirikbacker opened this issue Sep 18, 2024 · 5 comments
Open

Use u-tabs under the hood of Tabs? #2449

eirikbacker opened this issue Sep 18, 2024 · 5 comments
Assignees
Labels
🕵️ investigate Needs investigation react @digdir/designsystemet-react

Comments

@eirikbacker
Copy link
Contributor

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

@eirikbacker eirikbacker converted this from a draft issue Sep 18, 2024
@mimarz mimarz added react @digdir/designsystemet-react 🕵️ investigate Needs investigation labels Sep 23, 2024
@mimarz
Copy link
Collaborator

mimarz commented Sep 23, 2024

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.

@mimarz mimarz moved this from 🔵 Inbox to 📄 Todo in Team Designsystemet Sep 23, 2024
@eirikbacker
Copy link
Contributor Author

eirikbacker commented Sep 23, 2024

Quick example (not implemented controlled state): #2494

Pros:

  • I think the biggest benefit is that we have a non-React version ready for those users who need this :)
  • u-tabs is thoroughly tested - both by test-code, but also manually across a wide section of screen readers, in a depth that we would not have competence or resources to do in designsystemet.
  • Less code to maintain for Designsystemet
  • No need for value="" on every panel and every tab
  • ...feel free to add more items :)

Cons:

  • Needs to run client side to set initial state, but the if the consumer adds props they can fix state on server too:
<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>
  • ...feel free to add more items :)

@eirikbacker eirikbacker added this to the V1 - Helhetlig komponentbibliotek milestone Oct 24, 2024
@mrosvik mrosvik modified the milestones: V1 - Helhetlig komponentbibliotek, V1 - Must-have Dec 16, 2024
@mimarz mimarz moved this from 📄 Todo to 🏗 In progress in Team Designsystemet Jan 3, 2025
mimarz pushed a commit that referenced this issue Jan 14, 2025
Related to #2944 and
#2449

Fixes issues found in #2355
@mimarz
Copy link
Collaborator

mimarz commented Jan 15, 2025

awaiting #2964 for further work on this

@Barsnes
Copy link
Member

Barsnes commented Jan 20, 2025

Our own implementation of tabs is now feature equivalent to u-tabs.
If we don't want the issues we are experiencing with u-tabs in #2944 to affect the release of V1, we can put this issue on hold.

Our implementation of a tabs component has the same DOM structure as u-tabs, and if we update our css to target u-elements, we can still give a non-react option for consumers wanting this.

@Barsnes
Copy link
Member

Barsnes commented Jan 23, 2025

2025.01.25 @Barsnes @mimarz @eirikbacker
We have decided to not implement u-tabs for now, since non-react users have the possibility to use u-tabs. Our css targets our component and u-tabs. Our implementation of this will be released in V1.

Moving this to the backlog, as we might move to u-tabs later on.

PR #2944 had a few issues with rendering in chromatic visual tests. I will close that PR.

@Barsnes Barsnes moved this from 🏗 In progress to 📋 Backlog in Team Designsystemet Jan 23, 2025
@Barsnes Barsnes removed this from the V1 - Lansering milestone Jan 23, 2025
mimarz pushed a commit that referenced this issue Feb 21, 2025
Related to #2944 and
#2449

Fixes issues found in #2355
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🕵️ investigate Needs investigation react @digdir/designsystemet-react
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants