Create Accessible Keyboard Navigation Maps for Complex Web Layouts

Generate a logical, WCAG-compliant keyboard navigation sequence for complex web components to ensure full usability for screen reader and keyboard-only users.

Prompt

Prompt
Act as a Senior Accessibility Engineer. I will provide the HTML structure or a visual description of a web interface. Create a detailed keyboard navigation map. Follow these rules: 1. Define the exact tab order for all interactive elements. 2. Specify where roving tabindex patterns should be applied for navigation grids or tab lists. 3. Identify boundaries for focus traps in modals or off-canvas menus. 4. List any potential keyboard shortcut collisions with existing browser or screen reader commands. 5. Note the visual focus indicator requirements for each state. This information is for technical guidance and does not replace manual accessibility testing or compliance audits. Consult a certified accessibility specialist for legal verification. Output format: 1. Keyboard Navigation Map (Markdown Table with columns: Element, Tab Order, Focus Behavior, Notes). 2. Roving Tabindex Strategy (List of implementation steps). 3. Focus Trap Logic (Description of boundaries and exit conditions). 4. Potential Conflicts (List of risks). Please ask me to paste the interface description or HTML code now.

Example output

Example for: a side-navigation drawer that triggers a modal settings window.

1. Keyboard Navigation Map
ElementTab OrderFocus BehaviorNotes
Menu Toggle1Visually highlightedTriggers drawer
Drawer Item 12Outline visibleStandard anchor
Settings Button3Outline visibleTriggers modal
Modal Close4Immediate focusTraps focus inside
Modal Input5Cursor activeRequired field
2. Roving Tabindex Strategy
  1. Set tabindex 0 on the first active item in the drawer.
  2. Set tabindex -1 on all other items.
  3. Add keydown event listeners to handle ArrowUp and ArrowDown keys.
  4. On arrow press, move tabindex 0 to the target item and call .focus() immediately.
3. Focus Trap Logic
  • The focus trap initiates when the Modal opens. The browser focus must be programmatically moved to the Close button.
  • While the modal is active, the Shift+Tab key must cycle from the Close button to the final input field in the modal.
  • Pressing Escape must close the modal and return focus to the Settings Button that triggered it.
4. Potential Conflicts
  • The Escape key is standard for closing modals but may conflict with screen reader stop-commands if not handled via event.preventDefault().
  • Using Arrow keys for internal menu navigation may conflict with browser-native page scrolling if the menu is not focused.
Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Forces a structured, table-based audit that makes complex tab orders easy to visualize.
  • Specifically addresses the technical nuance of roving tabindex vs focus traps.
  • Includes a mandatory accessibility disclaimer to ensure professional responsibility.

Use this when building or auditing complex UIs like sidebars, modals, or data grids. Paste your HTML or a clear description of the component structure. Works in ChatGPT, Claude, and Gemini.

Common edits

  • Add specific browser-testing requirements if you are optimizing for Safari versus Chrome.
  • Include a section for screen reader announcements if the interface updates dynamically.

Make it repeatable

Keep using this prompt without pasting it in every time.

Keep exploring

More in Design