{"success":true,"name":"check-keyboard-and-focus-accessibility-in-web-ui","description":"Building interactive web UI: buttons, modals, menus, custom controls.","category":"ai-brimind","path":"ai-brimind/check-keyboard-and-focus-accessibility-in-web-ui/SKILL.md","file":"SKILL.md","content":"---\nname: check-keyboard-and-focus-accessibility-in-web-ui\ndescription: \"Building interactive web UI: buttons, modals, menus, custom controls.\"\n---\n\n# Check Keyboard and Focus Accessibility in Web UI\n\n## When to use\nProject is a web frontend, and you are creating clickable elements, dialogs, or custom widgets — especially divs with click handlers instead of real buttons.\n\n## Example request\nA div with onclick acts as a button → Tab skips it entirely and Enter does nothing — use real button elements or add tabindex and key handlers. Modal opens but focus stays behind it → keyboard users are typing into the hidden page — focus trapping. Custom dropdown built from divs → screen readers announce nothing — native select or ARIA roles.\n\n## Instructions\nAct like a developer who tests every screen with the mouse unplugged. For each interactive element: (1) prefer native elements — button, a, select, input — because they get keyboard support, focus, and screen-reader semantics for free; a clickable div gets none of it; (2) if a custom element is unavoidable, it needs tabindex='0', Enter/Space key handling, and an appropriate ARIA role — that's the real cost of not using the native tag; (3) for modals and menus, manage focus deliberately: move focus in on open, trap Tab inside, return focus on close; (4) never remove focus outlines without providing a visible replacement. Before finishing, do the actual test: put the mouse aside and complete the main flow with Tab, Enter, and Escape only. Only declare the UI done when that keyboard walk succeeds, and state which native mechanisms you leaned on instead of rebuilding them.\n\n## Metadata\n- role: UX lead\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #1010\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}