<rh-tab for="dom-id">
- separating tabs from their associated panels in the DOM
#635
Replies: 4 comments 12 replies
-
I'm gonna add my $0.02 for whatever it's worth in today's market 😅
Instead, we'd simply want: <!-- Two rectangles! -->
<header>
<nav>
<rh-tabs>
<rh-tab for="hello">Hello</rh-tab>
<rh-tab for="french">Bonjour</rh-tab>
<rh-tab for="hebrew">Shalom</rh-tab>
</rh-tabs>
</nav>
</header>
<main>
<rh-tab-panel id="hello" slot="panel">World</rh-tab-panel>
<rh-tab-panel id="french" slot="panel">Tout le monde</rh-tab-panel>
<rh-tab-panel id="hebrew" slot="panel">Aleichem</rh-tab-panel>
</main> On the flip side, there is a certain beauty to the |
Beta Was this translation helpful? Give feedback.
-
@bennypowers we had this conversation on the side when discussing adding explicit relationships functionality. This opens that conversation back up. I also agree with @markcaron about not having content such as a heading between tabs and the panel when detached. I feel like we are straying away from the general role of tabs and more into what is navigation semantics for the sake of the look and feel of the tabs with SPA like functionality. Tabs with explicit relationships as children <pfe-tabs id="explicit">
<pfe-tab slot="tab" aria-controls="panel-1">1</pfe-tab>
<pfe-tab slot="tab" aria-controls="panel-2">2</pfe-tab>
<pfe-tab slot="tab" aria-controls="panel-3">3</pfe-tab>
<pfe-tab slot="tab" aria-controls="panel-4">4</pfe-tab>
<pfe-tab slot="tab" aria-controls="panel-5">5</pfe-tab>
<pfe-tab-panel id="panel-5">5</pfe-tab-panel>
<pfe-tab-panel id="panel-4">4</pfe-tab-panel>
<pfe-tab-panel id="panel-3">3</pfe-tab-panel>
<pfe-tab-panel id="panel-2">2</pfe-tab-panel>
<pfe-tab-panel id="panel-1">1</pfe-tab-panel>
</pfe-tabs> What you are now proposing would look something more like this: Tabs with explicit relationships and detached panels <pfe-tabs id="detached">
<pfe-tab slot="tab" aria-controls="detached-1">1</pfe-tab>
<pfe-tab slot="tab" aria-controls="detached-2">2</pfe-tab>
<pfe-tab slot="tab" aria-controls="detached-3">3</pfe-tab>
<pfe-tab slot="tab" aria-controls="detached-4">4</pfe-tab>
<pfe-tab slot="tab" aria-controls="detached-5">5</pfe-tab>
</pfe-tabs>
<pfe-tab-panel id="detached-5">5</pfe-tab-panel>
<pfe-tab-panel id="detached-4">4</pfe-tab-panel>
<pfe-tab-panel id="detached-3">3</pfe-tab-panel>
<pfe-tab-panel id="detached-2">2</pfe-tab-panel>
<pfe-tab-panel id="detached-1">1</pfe-tab-panel> I wonder if we should use
|
Beta Was this translation helpful? Give feedback.
-
This is basically how I conceptualize it, too. |
Beta Was this translation helpful? Give feedback.
-
We've decided to move away from the "detached" tabs in favor of a Subnav, which will be a simpler version (in look and functionality) to Secondary Nav. See issue #703 for |
Beta Was this translation helpful? Give feedback.
-
The classic case of rh-tabs (or it's older cousin pf-tabs) looks like this:
This works, but BEHOLD: the whole tabs system is a single rectangle, and we can't put content between the tab bar and the active tab panel, and we can't really add new semantics to the tab bar. Compare with this aspirational snippet:
☝️ pick apart my awful semantics up there, sure; BUT we'd probably want to allow the header and nav semantics on the tab bar.
@nikkimk @brianferry thx for helping me think this through
@zeroedin welcome back from PTO 😉 and IIRC we discussed this previously: apologies if this discussion already lives somewhere else, I was unable to find it.
Beta Was this translation helpful? Give feedback.
All reactions