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

Look into using Radix's TabsContent component for <Tabs /> #131

Open
Tracked by #81
jessepinho opened this issue Jul 26, 2024 · 0 comments
Open
Tracked by #81

Look into using Radix's TabsContent component for <Tabs /> #131

jessepinho opened this issue Jul 26, 2024 · 0 comments

Comments

@jessepinho
Copy link
Contributor

jessepinho commented Jul 26, 2024

Per @VanishMax 's comment here:

suggestion (non-blocking, worth implementing): expose TabsContent component from Radix and somehow allow the children for Tabs.

If you inspect the markup of the Radix Tabs example, you can see that Tabs.Content components are nested inside the Tabs.Root. It allows Radix to set useful attributes like data-state="active" and role="tabpanel". Plus, there is a rendering logic involved that all [role="tabpanel"] divs are rendered but inactive divs have empty contents. All of this corresponds to W3C standards.

Developers might and probably will forget to implement this, so it would be useful to help them (and ourselves)

My response:

Good call — will look into it. I'm not sure that <TabsContent /> will be appropriate in our case, since we won't have multiple tab contents rendered on the page at the same time — <Tabs /> will usually be used for routing, I believe.

So, in short — this ticket may not be necessary. But if there's ever a case where multiple tabs' contents will be rendered at the same time (i.e., when the tabs aren't involved in routing), this would be worth looking into.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🗄️ Backlog
Development

No branches or pull requests

1 participant