coastdigitalgroup/coastai-skills/accessible-tabs-implementation
Claude Code and agent skill by coastdigitalgroup/coastai-skills
- community
Checking that the SKILL.md file is still in the repository.
Implement and debug accessible tabbed interfaces using WAI-ARIA roles, states, and keyboard interaction patterns.
Install
npx vskill@latest install coastdigitalgroup/coastai-skills/accessible-tabs-implementationSKILL.md
The same SKILL.md was published earlier as coastdigitalgroup/coastai-skills/accessible-tabs-implementation.
Accessible Tabs Implementation
Purpose
The Accessible Tabs Implementation skill provides a technical protocol for building tabbed interfaces that are fully accessible to screen reader users and keyboard-only navigators. It focuses on the correct application of ARIA roles (tablist, tab, tabpanel) and the implementation of standard keyboard interaction patterns (arrow key navigation).
Use Cases
- Dashboard Layouts: Organizing user data into logical, switchable sections.
- Product Information: Displaying specs, reviews, and descriptions in a
compact space.
- Settings Panels: Grouping configuration options without reloading the
page.
- Content Hubs: Switching between related categories of articles or media.
When NOT to Use
- Global Navigation: Use the
responsive-navigation-implementationskill for
site-wide menus. Tabs are for switching content _within_ a page, not for navigating between pages.
- Accordions: Use accordions if multiple sections of content need to be
expanded simultaneously or if the layout is vertically constrained on mobile.
- Simple Links: If clicking an item navigates the user to a new URL, use
standard links, not tabs.
Inputs
- Content Structure: A list of labels and their corresponding content
blocks.
- Activation Strategy: Decision on whether tabs should activate
automatically on focus or manually on click/keypress.
- Orientation: Horizontal (default) or Vertical layout.
Outputs
- Semantic HTML: A structure using appropriate ARIA roles and linking
attributes (aria-controls, aria-labelledby).
- Keyboard Logic: JavaScript handlers for
ArrowRight,ArrowLeft,
Home, End, and Enter/Space.
- Visual States: CSS for
[aria-selected="true"], focus indicators, and
panel visibility.
Workflow
1. Structure the Markup
- Container: Apply
role="tablist"to the wrapper of the tab buttons. - Buttons: Use
<button>elements withrole="tab". Link them to panels
using aria-controls.
- Panels: Use elements with
role="tabpanel". Link them to tabs using
aria-labelledby.
2. Manage State Attributes
- Set
aria-selected="true"on the active tab andfalseon others. - Ensure only the active tab is in the natural tab order (
tabindex="0"). All
other tabs must have tabindex="-1".
- Use the
hiddenattribute ordisplay: noneto hide inactive tab panels.
3. Implement Keyboard Interaction
- Arrow Keys: Listen for
ArrowRightandArrowLeft(or
ArrowUp/ArrowDown for vertical) to move focus between tabs.
- Looping: Ensure focus wraps from the last tab back to the first (and vice
versa).
- Home/End: (Optional but recommended) Support jumping to the first and last
tabs.
4. Apply Activation Logic
- Automatic Activation: The panel updates immediately as the user arrows
through the tabs. Recommended for fast-loading, local content.
- Manual Activation: The user must press
EnterorSpaceto switch panels
after focusing a tab. Recommended if switching content triggers a network request or an expensive render.
Decision Rules
- Automatic vs. Manual: Use Automatic by default for most UI tabs. Use
Manual ONLY if content loading is slow enough to cause a "stutter" in keyboard navigation.
- Vertical Orientation: Use
aria-orientation="vertical"on thetablist
if the tabs are stacked vertically. In this case, use ArrowUp and ArrowDown for navigation.
- Focusable Panels: If a
tabpaneldoes not contain any focusable elements
(like links or buttons), add tabindex="0" to the panel itself so keyboard users can reach the content.
Constraints
- Single Active Tab: Only one tab and one panel can be active at a time.
- No Hover-to-Switch: Tabs must never switch content purely on mouse hover;
this is inaccessible and frustrating for users.
- Visible Focus: Never remove the
outlinefrom a focused tab without
providing a high-contrast alternative.
Non-Goals
- Styling the "look and feel" of the tabs (e.g., colors, borders).
- Implementing multi-level nested tabs (avoid these for better UX).
- Handling browser "Back" button integration for tab state (though this is a
good advanced practice).
Common Failure Patterns
- Using Links for Tabs: Using
<a>tags withhref="#section"instead of
<button> with role="tab".
- Missing Tabindex: Forgetting to set
tabindex="-1"on inactive tabs,
forcing keyboard users to Tab through every single tab label before reaching the content.
- Focusing Inactive Panels: Allowing focus to reach elements inside a hidden
tab panel.
- No Arrow Support: Forcing users to use the
Tabkey to move between tabs
instead of the standard arrow-key pattern.
Validation Criteria
- [ ] Keyboard Navigation: Can you move between tabs using arrow keys? Does
focus wrap around?
- [ ] Selection State: Does
aria-selectedupdate correctly when a tab is
activated?
- [ ] Tab Order: Does pressing
Tabfrom an active tab move focus into the
panel (or the next page element), skipping the other tabs?
- [ ] Screen Reader Test: Does the screen reader announce "Tab, 1 of 3" and
indicate the selected state?
- [ ] Manual Activation (if applicable): If manual activation is used, do
Enter and Space trigger the panel switch?
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingwebsite-development/accessible-tabs-implementation/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/coastdigitalgroup/coastai-skills/accessible-tabs-implementation)