--- name: a11y-component-check description: Reviews UI component source (React, Vue, Svelte, Angular templates, plain HTML) for WCAG 2.2 AA failures such as missing labels, keyboard traps, focus handling, ARIA misuse, color contrast and target size, and reports findings with file and line or applies fixes. Use when the user asks for an accessibility, a11y or WCAG review of components or pages. --- # Accessibility component check Arguments: `$ARGUMENTS`. The first argument is a file or folder. If the word `fix` appears, apply fixes after reporting; otherwise report only. ## 1. Gather - Read every component file in scope plus the shared primitives it uses (Button, Icon, Modal, Input). - Find the color source: design tokens, CSS variables, Tailwind config. You need it for contrast. ## 2. Checklist Cite the WCAG 2.2 success criterion for each finding. **Semantics and names** - Click handlers on `div`/`span` without role, tabindex and key handling -> use `button` or `a` (2.1.1, 4.1.2). - Icon-only buttons and links have an accessible name via text, `aria-label` or `aria-labelledby` (4.1.2). - Images: informative images have descriptive `alt`; decorative ones have `alt=""` (1.1.1). - Form fields have a programmatic label; placeholder is not a label (1.3.1, 3.3.2). - Error messages are associated with fields (`aria-describedby`) and not conveyed by color alone (3.3.1, 1.4.1). - Headings follow a logical order; landmarks exist on page-level components (1.3.1). - Links say where they go; no repeated "click here" (2.4.4). **Keyboard and focus** - Everything operable by mouse is operable by keyboard (2.1.1). - No `tabindex` greater than 0 (2.4.3). - Focus outline not removed without a visible replacement (2.4.7). - Dialogs: focus moves into the dialog on open, stays inside while open, Escape closes it, and focus returns to the trigger on close (2.1.2, 2.4.3). A native `` opened with `showModal()` handles part of this. - Custom widgets (menus, tabs, comboboxes, listboxes) implement the expected keys from the ARIA Authoring Practices. - Focused element is not hidden behind sticky headers or overlays (2.4.11). **ARIA** - Roles and `aria-*` attributes are valid for the element. - No redundant roles (`