Use when implementing expand and collapse content sections.
日本語の概要は準備中です。原文の説明を表示しています。
Use when you need to switch between different views.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
Switch between different views
Tabs organize content into multiple panels that share the same space, allowing users to switch between views without leaving the page. Only one tab panel is visible at a time, while the tab list provides persistent indicators of all available sections. Tabs reduce information overload by letting users focus on one content section at a time while keeping the full set of options visible and reachable with a single click or keyboard press.
Use Tabs to organize related content into parallel sections at the same hierarchy level where users benefit from switching between views. Common scenarios include:
references/pattern.md, then choose the smallest viable variation.Do's ✅
role="tablist" on the tab container, role="tab" on each tab, and role="tabpanel" on each panelaria-selected="true" on the active tab and aria-selected="false" on inactive tabsaria-controls (on tab) and aria-labelledby (on panel)tabindex: active tab gets 0, inactive tabs get -1tabindex="0" to the active panel so users can Tab into the content
Don'ts ❌<a>) for tabs unless they navigate to a different URLKeep All Panels in DOM (Hidden)
<!-- Better than removing from DOM — preserves state -->
<div role="tabpanel" hidden>...</div>
The Problem:
Making each tab focusable with tabindex="0" forces keyboard users to Tab through every tab before reaching the content.
How to Fix It:
Use tabindex="-1" on inactive tabs and tabindex="0" only on the active tab. Navigate between tabs with Arrow Left/Right keys.
The Problem:
Using <div> or <button> without role="tab", role="tablist", or role="tabpanel" makes the tab interface invisible to screen readers.
How to Fix It:
Apply the full ARIA tab pattern: role="tablist" on the container, role="tab" on each trigger, role="tabpanel" on each content area, with aria-controls and aria-labelledby connections.
The Problem: Using tabs for page-level navigation causes full page reloads, breaking the instant-switch expectation of tab interfaces.
How to Fix It: Use a navigation menu for page-level navigation. Tabs should switch in-page content without a page load. If URL sync is needed, use hash fragments.
For full implementation detail, examples, and testing notes, see references/pattern.md.
Pattern page: https://uxpatterns.dev/patterns/navigation/tabs
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Use when implementing expand and collapse content sections.
日本語の概要は準備中です。原文の説明を表示しています。
Use when implementing user account configuration and preferences.
日本語の概要は準備中です。原文の説明を表示しています。
Use when implementing social activity and updates stream.
日本語の概要は準備中です。原文の説明を表示しています。
Use when implementing conversational AI chat interfaces.
日本語の概要は準備中です。原文の説明を表示しています。
Use when implementing handling AI-specific errors.
日本語の概要は準備中です。原文の説明を表示しています。
Use when implementing loading states for AI operations.
日本語の概要は準備中です。原文の説明を表示しています。