This content was loaded via AJAX as plain HTML. The component below uses the same event listener as the root component - no additional initialization needed!
YaiTabs uses YpsilonEventHandler's DOM Event Scoping System for efficient event handling:
[data-yai-tabs]
componentsautoDisambiguate: true
, makes identical data-open/data-tab values uniqueBelow we nest some top-nav with some other navs left and right.
Switch between fade
, slide-*
, zoom
, or flip
via data-behavior
. Keep transitions short (150–300ms) for snappy feel.
For content that shifts layout, consider overflow gating to avoid jank.
data-ref-path
key.hashchange
, containers reconcile their state (no loops: guarded writes).Use data-history-mode="replace"
to keep Back-stack clean on frequent tabbing.
data-default
marks the initial tab.data-open
sets the target panel ID.data-nav
controls nav position: top/bottom/left/right.Initialize only once per container; the component is idempotent by design.
When loading remote HTML:
aria-busy="true"
before fetch; reset to false
after.aria-live="polite"
for subtle SR announcements.Consider caching for quick back-navigation.
tabindex="0"
per tablist (roving tabindex).data-ref-path
per container:focus-visible
ring for all interactive elementsaria-orientation
consistent with computed layout<!--
Ca. 350 clicks
Reached level: 55
-->
<div data-yai-tabs data-nesting="55" />
Local metrics
Largest Contentful Paint (LCP) 0.16 s
Your local LCP value of 0.16 s is good. LCP elem. p
Cumulative Layout Shift (CLS) 0.17
Your local CLS value of 0.17 needs improvement.
Worst cluster 2 shifts Interaction to Next Paint (INP) 1,192 ms
Your local INP value of 1,192 ms is poor.
Respect user preferences with a simple CSS gate:
@media (prefers-reduced-motion: reduce) {
[data-yai-tabs] [data-tab] {
transition: none;
animation: none;
}
}
Keep parity in UX by retaining visual state changes without movement.
Click the "Load More Tabs" button below to experience truly infinite nesting. Each level will load the same already nested HTML tab component dynamically and insert it into the next hierarchy level. Just inserting the HTML transforms each insertion into a scoped standalone component. This components get never registered, only processed to adjust ARIA attributes. They can be deleted the same way they were injected, just llike that.
Demonstrates delay attributes: 500ms pre-fetch + 500ms post-fetch delay
💡 Key Insight: Nested tab components require 0 additional listeners - they reuse the existing root component listeners through YpsilonEventHandler's DOM event scoping system.