[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M78CCACNQK2EJ7Y296AX4YA7":3,"skill-same:01M78CCACNQK2EJ7Y296AX4YA7":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":26,"commitSha":27,"skillDirectory":28,"forksCount":14,"repositoryHtmlUrl":29,"repositoryHomepageUrl":30,"ownerHtmlUrl":31,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":32,"install":33,"resources":46},"01M78CCACNQK2EJ7Y296AX4YA7","frontend-a11y",null,"Accessibility patterns for React and Next.js — semantic HTML, ARIA attributes, form labeling, keyboard navigation, focus management, and screen reader support. Use when building any interactive UI component or form.","princepatel04477-web\u002Ftrivoxa-group","princepatel04477-web","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F227740714?v=4","01M788ZAJ2KECD5KXVP55PZXKS","Prince Patel","01M788ZAJTCN8YSD737MRSKC5Q",0,"MIT","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Ffrontend-a11y\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: frontend-a11y\ndescription: >\n  Accessibility patterns for React and Next.js — semantic HTML, ARIA attributes,\n  form labeling, keyboard navigation, focus management, and screen reader support.\n  Use when building any interactive UI component or form.\norigin: community\n---\n\n# Frontend Accessibility Patterns\n\nPractical accessibility patterns for React and Next.js. Covers the issues most commonly flagged in code review: missing form labels, incorrect ARIA usage, non-semantic interactive elements, and broken keyboard navigation.\n\n## When to Activate\n\n- Building or reviewing form components (`\u003Cinput>`, `\u003Cselect>`, `\u003Ctextarea>`)\n- Creating interactive elements (modals, dropdowns, tooltips, tabs)\n- Using `\u003Cdiv>` or `\u003Cspan>` with `onClick`\n- Adding `aria-*` attributes to any element\n- Implementing keyboard navigation or focus management\n- Receiving accessibility feedback from code review tools (CodeRabbit, ESLint a11y)\n- Building components that must support screen readers\n\n## Form Accessibility\n\nMissing `htmlFor` \u002F `id` pairing and disconnected error messages are the most common issues flagged in code review.\n\n### Label Connection\n\n```tsx\n\u002F\u002F BAD: label has no connection to input — screen readers cannot associate them\n\u003Clabel>Email\u003C\u002Flabel>\n\u003Cinput type=\"email\" \u002F>\n\n\u002F\u002F GOOD: htmlFor matches input id\n\u003Clabel htmlFor=\"email\">Email\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n```\n\n### Required Fields\n\n```tsx\n\u002F\u002F BAD: visual-only asterisk conveys nothing to screen readers\n\u003Clabel htmlFor=\"email\">Email *\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n\n\u002F\u002F GOOD: required enables native browser validation; aria-required signals it to screen readers\n\u003Clabel htmlFor=\"email\">\n  Email \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" required aria-required=\"true\" \u002F>\n```\n\n### Error Messages\n\n```tsx\n\u002F\u002F BAD: error text exists visually but is not linked to the input\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n\u003Cspan className=\"error\">Invalid email address\u003C\u002Fspan>\n\n\u002F\u002F GOOD: aria-describedby connects input to its error message\n\u002F\u002F aria-invalid signals the invalid state to screen readers\n\u003Cinput\n  id=\"email\"\n  type=\"email\"\n  aria-describedby=\"email-error\"\n  aria-invalid={!!error}\n\u002F>\n{error && (\n  \u003Cspan id=\"email-error\" role=\"alert\">\n    {error}\n  \u003C\u002Fspan>\n)}\n```\n\n### Complete Accessible Form\n\n```tsx\ninterface LoginFormProps {\n  onSubmit: (email: string, password: string) => void;\n}\n\nexport function LoginForm({ onSubmit }: LoginFormProps) {\n  const [email, setEmail] = useState('');\n  const [password, setPassword] = useState('');\n  const [errors, setErrors] = useState\u003C{ email?: string; password?: string }>({});\n\n  const handleSubmit = (e: React.FormEvent) => {\n    e.preventDefault();\n    const newErrors: typeof errors = {};\n    if (!email) newErrors.email = 'Email is required';\n    if (!password) newErrors.password = 'Password is required';\n    if (Object.keys(newErrors).length) {\n      setErrors(newErrors);\n      return;\n    }\n    onSubmit(email, password);\n  };\n\n  return (\n    \u003Cform onSubmit={handleSubmit} noValidate>\n      \u003Cdiv>\n        \u003Clabel htmlFor=\"email\">\n          Email \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n        \u003C\u002Flabel>\n        \u003Cinput\n          id=\"email\"\n          type=\"email\"\n          value={email}\n          onChange={e => setEmail(e.target.value)}\n          aria-required=\"true\"\n          aria-describedby={errors.email ? 'email-error' : undefined}\n          aria-invalid={!!errors.email}\n          autoComplete=\"email\"\n        \u002F>\n        {errors.email && (\n          \u003Cspan id=\"email-error\" role=\"alert\">\n            {errors.email}\n          \u003C\u002Fspan>\n        )}\n      \u003C\u002Fdiv>\n\n      \u003Cdiv>\n        \u003Clabel htmlFor=\"password\">\n          Password \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n        \u003C\u002Flabel>\n        \u003Cinput\n          id=\"password\"\n          type=\"password\"\n          value={password}\n          onChange={e => setPassword(e.target.value)}\n          aria-required=\"true\"\n          aria-describedby={errors.password ? 'password-error' : undefined}\n          aria-invalid={!!errors.password}\n          autoComplete=\"current-password\"\n        \u002F>\n        {errors.password && (\n          \u003Cspan id=\"password-error\" role=\"alert\">\n            {errors.password}\n          \u003C\u002Fspan>\n        )}\n      \u003C\u002Fdiv>\n\n      \u003Cbutton type=\"submit\">Log in\u003C\u002Fbutton>\n    \u003C\u002Fform>\n  );\n}\n```\n\n## Semantic HTML\n\nUse the element that matches the intent. Screen readers and keyboard users depend on native semantics.\n\n```tsx\n\u002F\u002F BAD: div has no role, no keyboard support, no accessible name\n\u003Cdiv onClick={handleClick}>Submit\u003C\u002Fdiv>\n\n\u002F\u002F GOOD: button is focusable, activates on Enter\u002FSpace, announces as \"button\"\n\u003Cbutton type=\"button\" onClick={handleClick}>Submit\u003C\u002Fbutton>\n```\n\n```tsx\n\u002F\u002F BAD: non-semantic navigation\n\u003Cdiv onClick={() => navigate('\u002Fhome')}>Home\u003C\u002Fdiv>\n\n\u002F\u002F GOOD: anchor supports right-click, middle-click, and keyboard navigation\n\u003Ca href=\"\u002Fhome\">Home\u003C\u002Fa>\n```\n\n```tsx\n\u002F\u002F BAD: heading hierarchy skipped (h1 to h4)\n\u003Ch1>Dashboard\u003C\u002Fh1>\n\u003Ch4>Recent Activity\u003C\u002Fh4>\n\n\u002F\u002F GOOD: sequential heading levels\n\u003Ch1>Dashboard\u003C\u002Fh1>\n\u003Ch2>Recent Activity\u003C\u002Fh2>\n```\n\n## ARIA Attributes\n\nUse ARIA only when native HTML semantics are insufficient. Wrong ARIA is worse than no ARIA.\n\n### aria-label vs aria-labelledby\n\n```tsx\n\u002F\u002F aria-label: inline string label — use when no visible label text exists\n\u003Cbutton aria-label=\"Close modal\">\n  \u003CXIcon \u002F>\n\u003C\u002Fbutton>\n\n\u002F\u002F aria-labelledby: references another element's text — use when a visible label exists\n\u003Csection aria-labelledby=\"section-title\">\n  \u003Ch2 id=\"section-title\">Recent Orders\u003C\u002Fh2>\n  {\u002F* content *\u002F}\n\u003C\u002Fsection>\n```\n\n### aria-describedby\n\n```tsx\n\u002F\u002F Provides supplementary description beyond the label\n\u003Cbutton\n  aria-describedby=\"delete-warning\"\n  onClick={handleDelete}\n>\n  Delete account\n\u003C\u002Fbutton>\n\u003Cp id=\"delete-warning\">This action cannot be undone.\u003C\u002Fp>\n```\n\n### aria-live for Dynamic Content\n\n```tsx\n\u002F\u002F Use aria-live to announce content that updates without a page reload\n\u002F\u002F polite: waits for user to finish current action before announcing\n\u002F\u002F assertive: interrupts immediately — use only for urgent errors\n\nexport function StatusMessage({ message, isError }: { message: string; isError?: boolean }) {\n  return (\n    \u003Cdiv role=\"status\" aria-live={isError ? 'assertive' : 'polite'} aria-atomic=\"true\">\n      {message}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n### aria-expanded and aria-controls\n\n```tsx\nexport function Accordion({ title, children }: { title: string; children: React.ReactNode }) {\n  const [isOpen, setIsOpen] = useState(false);\n  const contentId = useId();\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton aria-expanded={isOpen} aria-controls={contentId} onClick={() => setIsOpen(prev => !prev)}>\n        {title}\n      \u003C\u002Fbutton>\n      \u003Cdiv id={contentId} hidden={!isOpen}>\n        {children}\n      \u003C\u002Fdiv>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Keyboard Navigation\n\nEvery interactive element must be reachable and operable by keyboard alone.\n\n### Custom Dropdown\n\n```tsx\nexport function Dropdown({ options, onSelect }: { options: string[]; onSelect: (value: string) => void }) {\n  const [isOpen, setIsOpen] = useState(false);\n  const [activeIndex, setActiveIndex] = useState(0);\n  const listId = useId();\n\n  if (!options.length) return null;\n\n  const handleKeyDown = (e: React.KeyboardEvent) => {\n    switch (e.key) {\n      case 'ArrowDown':\n        e.preventDefault();\n        setActiveIndex(i => Math.min(i + 1, options.length - 1));\n        break;\n      case 'ArrowUp':\n        e.preventDefault();\n        setActiveIndex(i => Math.max(i - 1, 0));\n        break;\n      case 'Enter':\n      case ' ':\n        e.preventDefault();\n        if (isOpen) onSelect(options[activeIndex]);\n        setIsOpen(prev => !prev);\n        break;\n      case 'Escape':\n        setIsOpen(false);\n        break;\n    }\n  };\n\n  return (\n    \u003Cdiv\n      role=\"combobox\"\n      aria-expanded={isOpen}\n      aria-haspopup=\"listbox\"\n      aria-controls={listId}\n      tabIndex={0}\n      onKeyDown={handleKeyDown}\n      onClick={() => setIsOpen(prev => !prev)}\n    >\n      \u003Cspan>{options[activeIndex]}\u003C\u002Fspan>\n      {isOpen && (\n        \u003Cul id={listId} role=\"listbox\">\n          {options.map((option, index) => (\n            \u003Cli\n              key={option}\n              role=\"option\"\n              aria-selected={index === activeIndex}\n              onClick={() => {\n                onSelect(option);\n                setIsOpen(false);\n              }}\n            >\n              {option}\n            \u003C\u002Fli>\n          ))}\n        \u003C\u002Ful>\n      )}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Focus Management\n\nFocus must move logically when UI state changes — especially for modals and route transitions.\n\n### Modal Focus Restoration\n\n> This example covers initial focus and restoration. For a full focus trap (Tab\u002FShift+Tab cycling within the modal), use a library like [`focus-trap-react`](https:\u002F\u002Fgithub.com\u002Ffocus-trap\u002Ffocus-trap-react) which handles edge cases like dynamic content and nested portals.\n\n```tsx\nexport function Modal({ isOpen, onClose, title, children }: { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode }) {\n  const modalRef = useRef\u003CHTMLDivElement>(null);\n  const previousFocusRef = useRef\u003CHTMLElement | null>(null);\n\n  useEffect(() => {\n    if (isOpen) {\n      \u002F\u002F Save currently focused element and move focus into modal\n      previousFocusRef.current = document.activeElement as HTMLElement;\n      modalRef.current?.focus();\n    } else {\n      \u002F\u002F Restore focus to the element that opened the modal\n      previousFocusRef.current?.focus();\n    }\n  }, [isOpen]);\n\n  if (!isOpen) return null;\n\n  return (\n    \u003Cdiv ref={modalRef} role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"modal-title\" tabIndex={-1} onKeyDown={e => e.key === 'Escape' && onClose()}>\n      \u003Ch2 id=\"modal-title\">{title}\u003C\u002Fh2>\n      {children}\n      \u003Cbutton onClick={onClose}>Close\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Images and Icons\n\n```tsx\n\u002F\u002F BAD: decorative icon announced as unlabeled image\n\u003Cimg src=\"\u002Ficon.svg\" \u002F>\n\n\u002F\u002F GOOD: decorative image hidden from screen readers\n\u003Cimg src=\"\u002Fdecoration.png\" alt=\"\" aria-hidden=\"true\" \u002F>\n\n\u002F\u002F GOOD: meaningful image with descriptive alt text\n\u003Cimg src=\"\u002Fchart.png\" alt=\"Monthly revenue increased 23% from January to March\" \u002F>\n\n\u002F\u002F GOOD: icon button with accessible label\n\u003Cbutton aria-label=\"Delete item\">\n  \u003CTrashIcon aria-hidden=\"true\" \u002F>\n\u003C\u002Fbutton>\n```\n\n## Reduced Motion\n\nRespect users who have requested reduced motion in their OS settings.\n\n```tsx\nexport function useReducedMotion(): boolean {\n  const [prefersReduced, setPrefersReduced] = useState(false);\n\n  useEffect(() => {\n    const mq = window.matchMedia('(prefers-reduced-motion: reduce)');\n    setPrefersReduced(mq.matches);\n    const handler = (e: MediaQueryListEvent) => setPrefersReduced(e.matches);\n    mq.addEventListener('change', handler);\n    return () => mq.removeEventListener('change', handler);\n  }, []);\n\n  return prefersReduced;\n}\n\n\u002F\u002F Usage\nexport function AnimatedCard({ children }: { children: React.ReactNode }) {\n  const reduceMotion = useReducedMotion();\n\n  return (\n    \u003Cdiv\n      style={{\n        transition: reduceMotion ? 'none' : 'transform 300ms ease'\n      }}\n    >\n      {children}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Anti-Patterns\n\n```tsx\n\u002F\u002F BAD: onClick on non-interactive element with no keyboard support\n\u003Cdiv onClick={handleClick}>Click me\u003C\u002Fdiv>\n\n\u002F\u002F BAD: aria-label on a div that has no role\n\u003Cdiv aria-label=\"Navigation\">...\u003C\u002Fdiv>\n\n\u002F\u002F BAD: placeholder used as a substitute for label\n\u003Cinput placeholder=\"Enter your email\" \u002F>\n\n\u002F\u002F BAD: positive tabIndex creates unpredictable tab order\n\u003Cbutton tabIndex={3}>Submit\u003C\u002Fbutton>\n\n\u002F\u002F BAD: aria-hidden on a focusable element — keyboard users get trapped\n\u003Cbutton aria-hidden=\"true\">Open\u003C\u002Fbutton>\n\n\u002F\u002F BAD: role=\"button\" on div without keyboard handler\n\u003Cdiv role=\"button\" onClick={handleClick}>Submit\u003C\u002Fdiv>\n\u002F\u002F Missing: tabIndex={0}, onKeyDown for Enter\u002FSpace\n```\n\n## Checklist\n\nBefore submitting any interactive component for review:\n\n- [ ] Every `\u003Cinput>`, `\u003Cselect>`, and `\u003Ctextarea>` has a connected `\u003Clabel>` via `htmlFor`\u002F`id`\n- [ ] Error messages are linked with `aria-describedby` and marked `role=\"alert\"`\n- [ ] No `onClick` on `\u003Cdiv>` or `\u003Cspan>` without `role`, `tabIndex`, and `onKeyDown`\n- [ ] Icon-only buttons have `aria-label`\n- [ ] Decorative images use `alt=\"\"` and `aria-hidden=\"true\"`\n- [ ] Modals restore focus on close (for full focus trapping with Tab\u002FShift+Tab cycling, use a library like `focus-trap-react`)\n- [ ] Dynamic content updates use `aria-live`\n- [ ] `prefers-reduced-motion` is respected for animations\n\n## Related Skills\n\n- `frontend-patterns` — general React component and state patterns\n- `design-system` — design token and component consistency\n- `motion-ui` — animation patterns with accessibility considerations\n","# Frontend Accessibility Patterns\n\nPractical accessibility patterns for React and Next.js. Covers the issues most commonly flagged in code review: missing form labels, incorrect ARIA usage, non-semantic interactive elements, and broken keyboard navigation.\n\n## When to Activate\n\n- Building or reviewing form components (`\u003Cinput>`, `\u003Cselect>`, `\u003Ctextarea>`)\n- Creating interactive elements (modals, dropdowns, tooltips, tabs)\n- Using `\u003Cdiv>` or `\u003Cspan>` with `onClick`\n- Adding `aria-*` attributes to any element\n- Implementing keyboard navigation or focus management\n- Receiving accessibility feedback from code review tools (CodeRabbit, ESLint a11y)\n- Building components that must support screen readers\n\n## Form Accessibility\n\nMissing `htmlFor` \u002F `id` pairing and disconnected error messages are the most common issues flagged in code review.\n\n### Label Connection\n\n```tsx\n\u002F\u002F BAD: label has no connection to input — screen readers cannot associate them\n\u003Clabel>Email\u003C\u002Flabel>\n\u003Cinput type=\"email\" \u002F>\n\n\u002F\u002F GOOD: htmlFor matches input id\n\u003Clabel htmlFor=\"email\">Email\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n```\n\n### Required Fields\n\n```tsx\n\u002F\u002F BAD: visual-only asterisk conveys nothing to screen readers\n\u003Clabel htmlFor=\"email\">Email *\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n\n\u002F\u002F GOOD: required enables native browser validation; aria-required signals it to screen readers\n\u003Clabel htmlFor=\"email\">\n  Email \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n\u003C\u002Flabel>\n\u003Cinput id=\"email\" type=\"email\" required aria-required=\"true\" \u002F>\n```\n\n### Error Messages\n\n```tsx\n\u002F\u002F BAD: error text exists visually but is not linked to the input\n\u003Cinput id=\"email\" type=\"email\" \u002F>\n\u003Cspan className=\"error\">Invalid email address\u003C\u002Fspan>\n\n\u002F\u002F GOOD: aria-describedby connects input to its error message\n\u002F\u002F aria-invalid signals the invalid state to screen readers\n\u003Cinput\n  id=\"email\"\n  type=\"email\"\n  aria-describedby=\"email-error\"\n  aria-invalid={!!error}\n\u002F>\n{error && (\n  \u003Cspan id=\"email-error\" role=\"alert\">\n    {error}\n  \u003C\u002Fspan>\n)}\n```\n\n### Complete Accessible Form\n\n```tsx\ninterface LoginFormProps {\n  onSubmit: (email: string, password: string) => void;\n}\n\nexport function LoginForm({ onSubmit }: LoginFormProps) {\n  const [email, setEmail] = useState('');\n  const [password, setPassword] = useState('');\n  const [errors, setErrors] = useState\u003C{ email?: string; password?: string }>({});\n\n  const handleSubmit = (e: React.FormEvent) => {\n    e.preventDefault();\n    const newErrors: typeof errors = {};\n    if (!email) newErrors.email = 'Email is required';\n    if (!password) newErrors.password = 'Password is required';\n    if (Object.keys(newErrors).length) {\n      setErrors(newErrors);\n      return;\n    }\n    onSubmit(email, password);\n  };\n\n  return (\n    \u003Cform onSubmit={handleSubmit} noValidate>\n      \u003Cdiv>\n        \u003Clabel htmlFor=\"email\">\n          Email \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n        \u003C\u002Flabel>\n        \u003Cinput\n          id=\"email\"\n          type=\"email\"\n          value={email}\n          onChange={e => setEmail(e.target.value)}\n          aria-required=\"true\"\n          aria-describedby={errors.email ? 'email-error' : undefined}\n          aria-invalid={!!errors.email}\n          autoComplete=\"email\"\n        \u002F>\n        {errors.email && (\n          \u003Cspan id=\"email-error\" role=\"alert\">\n            {errors.email}\n          \u003C\u002Fspan>\n        )}\n      \u003C\u002Fdiv>\n\n      \u003Cdiv>\n        \u003Clabel htmlFor=\"password\">\n          Password \u003Cspan aria-hidden=\"true\">*\u003C\u002Fspan>\n        \u003C\u002Flabel>\n        \u003Cinput\n          id=\"password\"\n          type=\"password\"\n          value={password}\n          onChange={e => setPassword(e.target.value)}\n          aria-required=\"true\"\n          aria-describedby={errors.password ? 'password-error' : undefined}\n          aria-invalid={!!errors.password}\n          autoComplete=\"current-password\"\n        \u002F>\n        {errors.password && (\n          \u003Cspan id=\"password-error\" role=\"alert\">\n            {errors.password}\n          \u003C\u002Fspan>\n        )}\n      \u003C\u002Fdiv>\n\n      \u003Cbutton type=\"submit\">Log in\u003C\u002Fbutton>\n    \u003C\u002Fform>\n  );\n}\n```\n\n## Semantic HTML\n\nUse the element that matches the intent. Screen readers and keyboard users depend on native semantics.\n\n```tsx\n\u002F\u002F BAD: div has no role, no keyboard support, no accessible name\n\u003Cdiv onClick={handleClick}>Submit\u003C\u002Fdiv>\n\n\u002F\u002F GOOD: button is focusable, activates on Enter\u002FSpace, announces as \"button\"\n\u003Cbutton type=\"button\" onClick={handleClick}>Submit\u003C\u002Fbutton>\n```\n\n```tsx\n\u002F\u002F BAD: non-semantic navigation\n\u003Cdiv onClick={() => navigate('\u002Fhome')}>Home\u003C\u002Fdiv>\n\n\u002F\u002F GOOD: anchor supports right-click, middle-click, and keyboard navigation\n\u003Ca href=\"\u002Fhome\">Home\u003C\u002Fa>\n```\n\n```tsx\n\u002F\u002F BAD: heading hierarchy skipped (h1 to h4)\n\u003Ch1>Dashboard\u003C\u002Fh1>\n\u003Ch4>Recent Activity\u003C\u002Fh4>\n\n\u002F\u002F GOOD: sequential heading levels\n\u003Ch1>Dashboard\u003C\u002Fh1>\n\u003Ch2>Recent Activity\u003C\u002Fh2>\n```\n\n## ARIA Attributes\n\nUse ARIA only when native HTML semantics are insufficient. Wrong ARIA is worse than no ARIA.\n\n### aria-label vs aria-labelledby\n\n```tsx\n\u002F\u002F aria-label: inline string label — use when no visible label text exists\n\u003Cbutton aria-label=\"Close modal\">\n  \u003CXIcon \u002F>\n\u003C\u002Fbutton>\n\n\u002F\u002F aria-labelledby: references another element's text — use when a visible label exists\n\u003Csection aria-labelledby=\"section-title\">\n  \u003Ch2 id=\"section-title\">Recent Orders\u003C\u002Fh2>\n  {\u002F* content *\u002F}\n\u003C\u002Fsection>\n```\n\n### aria-describedby\n\n```tsx\n\u002F\u002F Provides supplementary description beyond the label\n\u003Cbutton\n  aria-describedby=\"delete-warning\"\n  onClick={handleDelete}\n>\n  Delete account\n\u003C\u002Fbutton>\n\u003Cp id=\"delete-warning\">This action cannot be undone.\u003C\u002Fp>\n```\n\n### aria-live for Dynamic Content\n\n```tsx\n\u002F\u002F Use aria-live to announce content that updates without a page reload\n\u002F\u002F polite: waits for user to finish current action before announcing\n\u002F\u002F assertive: interrupts immediately — use only for urgent errors\n\nexport function StatusMessage({ message, isError }: { message: string; isError?: boolean }) {\n  return (\n    \u003Cdiv role=\"status\" aria-live={isError ? 'assertive' : 'polite'} aria-atomic=\"true\">\n      {message}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n### aria-expanded and aria-controls\n\n```tsx\nexport function Accordion({ title, children }: { title: string; children: React.ReactNode }) {\n  const [isOpen, setIsOpen] = useState(false);\n  const contentId = useId();\n\n  return (\n    \u003Cdiv>\n      \u003Cbutton aria-expanded={isOpen} aria-controls={contentId} onClick={() => setIsOpen(prev => !prev)}>\n        {title}\n      \u003C\u002Fbutton>\n      \u003Cdiv id={contentId} hidden={!isOpen}>\n        {children}\n      \u003C\u002Fdiv>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Keyboard Navigation\n\nEvery interactive element must be reachable and operable by keyboard alone.\n\n### Custom Dropdown\n\n```tsx\nexport function Dropdown({ options, onSelect }: { options: string[]; onSelect: (value: string) => void }) {\n  const [isOpen, setIsOpen] = useState(false);\n  const [activeIndex, setActiveIndex] = useState(0);\n  const listId = useId();\n\n  if (!options.length) return null;\n\n  const handleKeyDown = (e: React.KeyboardEvent) => {\n    switch (e.key) {\n      case 'ArrowDown':\n        e.preventDefault();\n        setActiveIndex(i => Math.min(i + 1, options.length - 1));\n        break;\n      case 'ArrowUp':\n        e.preventDefault();\n        setActiveIndex(i => Math.max(i - 1, 0));\n        break;\n      case 'Enter':\n      case ' ':\n        e.preventDefault();\n        if (isOpen) onSelect(options[activeIndex]);\n        setIsOpen(prev => !prev);\n        break;\n      case 'Escape':\n        setIsOpen(false);\n        break;\n    }\n  };\n\n  return (\n    \u003Cdiv\n      role=\"combobox\"\n      aria-expanded={isOpen}\n      aria-haspopup=\"listbox\"\n      aria-controls={listId}\n      tabIndex={0}\n      onKeyDown={handleKeyDown}\n      onClick={() => setIsOpen(prev => !prev)}\n    >\n      \u003Cspan>{options[activeIndex]}\u003C\u002Fspan>\n      {isOpen && (\n        \u003Cul id={listId} role=\"listbox\">\n          {options.map((option, index) => (\n            \u003Cli\n              key={option}\n              role=\"option\"\n              aria-selected={index === activeIndex}\n              onClick={() => {\n                onSelect(option);\n                setIsOpen(false);\n              }}\n            >\n              {option}\n            \u003C\u002Fli>\n          ))}\n        \u003C\u002Ful>\n      )}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Focus Management\n\nFocus must move logically when UI state changes — especially for modals and route transitions.\n\n### Modal Focus Restoration\n\n> This example covers initial focus and restoration. For a full focus trap (Tab\u002FShift+Tab cycling within the modal), use a library like [`focus-trap-react`](https:\u002F\u002Fgithub.com\u002Ffocus-trap\u002Ffocus-trap-react) which handles edge cases like dynamic content and nested portals.\n\n```tsx\nexport function Modal({ isOpen, onClose, title, children }: { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode }) {\n  const modalRef = useRef\u003CHTMLDivElement>(null);\n  const previousFocusRef = useRef\u003CHTMLElement | null>(null);\n\n  useEffect(() => {\n    if (isOpen) {\n      \u002F\u002F Save currently focused element and move focus into modal\n      previousFocusRef.current = document.activeElement as HTMLElement;\n      modalRef.current?.focus();\n    } else {\n      \u002F\u002F Restore focus to the element that opened the modal\n      previousFocusRef.current?.focus();\n    }\n  }, [isOpen]);\n\n  if (!isOpen) return null;\n\n  return (\n    \u003Cdiv ref={modalRef} role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"modal-title\" tabIndex={-1} onKeyDown={e => e.key === 'Escape' && onClose()}>\n      \u003Ch2 id=\"modal-title\">{title}\u003C\u002Fh2>\n      {children}\n      \u003Cbutton onClick={onClose}>Close\u003C\u002Fbutton>\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Images and Icons\n\n```tsx\n\u002F\u002F BAD: decorative icon announced as unlabeled image\n\u003Cimg src=\"\u002Ficon.svg\" \u002F>\n\n\u002F\u002F GOOD: decorative image hidden from screen readers\n\u003Cimg src=\"\u002Fdecoration.png\" alt=\"\" aria-hidden=\"true\" \u002F>\n\n\u002F\u002F GOOD: meaningful image with descriptive alt text\n\u003Cimg src=\"\u002Fchart.png\" alt=\"Monthly revenue increased 23% from January to March\" \u002F>\n\n\u002F\u002F GOOD: icon button with accessible label\n\u003Cbutton aria-label=\"Delete item\">\n  \u003CTrashIcon aria-hidden=\"true\" \u002F>\n\u003C\u002Fbutton>\n```\n\n## Reduced Motion\n\nRespect users who have requested reduced motion in their OS settings.\n\n```tsx\nexport function useReducedMotion(): boolean {\n  const [prefersReduced, setPrefersReduced] = useState(false);\n\n  useEffect(() => {\n    const mq = window.matchMedia('(prefers-reduced-motion: reduce)');\n    setPrefersReduced(mq.matches);\n    const handler = (e: MediaQueryListEvent) => setPrefersReduced(e.matches);\n    mq.addEventListener('change', handler);\n    return () => mq.removeEventListener('change', handler);\n  }, []);\n\n  return prefersReduced;\n}\n\n\u002F\u002F Usage\nexport function AnimatedCard({ children }: { children: React.ReactNode }) {\n  const reduceMotion = useReducedMotion();\n\n  return (\n    \u003Cdiv\n      style={{\n        transition: reduceMotion ? 'none' : 'transform 300ms ease'\n      }}\n    >\n      {children}\n    \u003C\u002Fdiv>\n  );\n}\n```\n\n## Anti-Patterns\n\n```tsx\n\u002F\u002F BAD: onClick on non-interactive element with no keyboard support\n\u003Cdiv onClick={handleClick}>Click me\u003C\u002Fdiv>\n\n\u002F\u002F BAD: aria-label on a div that has no role\n\u003Cdiv aria-label=\"Navigation\">...\u003C\u002Fdiv>\n\n\u002F\u002F BAD: placeholder used as a substitute for label\n\u003Cinput placeholder=\"Enter your email\" \u002F>\n\n\u002F\u002F BAD: positive tabIndex creates unpredictable tab order\n\u003Cbutton tabIndex={3}>Submit\u003C\u002Fbutton>\n\n\u002F\u002F BAD: aria-hidden on a focusable element — keyboard users get trapped\n\u003Cbutton aria-hidden=\"true\">Open\u003C\u002Fbutton>\n\n\u002F\u002F BAD: role=\"button\" on div without keyboard handler\n\u003Cdiv role=\"button\" onClick={handleClick}>Submit\u003C\u002Fdiv>\n\u002F\u002F Missing: tabIndex={0}, onKeyDown for Enter\u002FSpace\n```\n\n## Checklist\n\nBefore submitting any interactive component for review:\n\n- [ ] Every `\u003Cinput>`, `\u003Cselect>`, and `\u003Ctextarea>` has a connected `\u003Clabel>` via `htmlFor`\u002F`id`\n- [ ] Error messages are linked with `aria-describedby` and marked `role=\"alert\"`\n- [ ] No `onClick` on `\u003Cdiv>` or `\u003Cspan>` without `role`, `tabIndex`, and `onKeyDown`\n- [ ] Icon-only buttons have `aria-label`\n- [ ] Decorative images use `alt=\"\"` and `aria-hidden=\"true\"`\n- [ ] Modals restore focus on close (for full focus trapping with Tab\u002FShift+Tab cycling, use a library like `focus-trap-react`)\n- [ ] Dynamic content updates use `aria-live`\n- [ ] `prefers-reduced-motion` is respected for animations\n\n## Related Skills\n\n- `frontend-patterns` — general React component and state patterns\n- `design-system` — design token and component consistency\n- `motion-ui` — animation patterns with accessibility considerations\n",{"name":5,"origin":24,"description":25},"community","Accessibility patterns for React and Next.js — semantic HTML, ARIA attributes, form labeling, keyboard navigation, focus management, and screen reader support. Use when building any interactive UI component or form.\n","master","877653a671c51fae6476bd9f0d34ee6c408d68b9",".github\u002Fskills\u002Ffrontend-a11y","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group","https:\u002F\u002Ftrivoxa-group.vercel.app","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web","2026-08-01 17:29:31",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add princepatel04477-web\u002Ftrivoxa-group --skill frontend-a11y",{"tool":39,"command":40},"bunx","bunx skills add princepatel04477-web\u002Ftrivoxa-group --skill frontend-a11y",{"tool":42,"command":43},"pnpm","pnpm dlx skills add princepatel04477-web\u002Ftrivoxa-group --skill frontend-a11y","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Ffrontend-a11y\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":19},"01M78G4Z5RFJ72G536XYPC77PG","zustand-store-ts","Create Zustand stores following established patterns with proper TypeScript types and middleware.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzustand-store-ts\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":19},"01M78G4WQMHRST36KDP7AV3NR3","zoom-automation","Automate Zoom meeting creation, management, recordings, webinars, and participant tracking via Rube MCP (Composio). Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzoom-automation\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":19},"01M78G4T37F4SPS7M4KT0A8JJB","zoho-crm-automation","Automate Zoho CRM tasks via Rube MCP (Composio): create\u002Fupdate records, search contacts, manage leads, and convert leads. Always search tools first for current schemas.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzoho-crm-automation\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":19},"01M78G4QAJMF71KD1G38MNDQYK","zod-validation-expert","Expert in Zod — TypeScript-first schema validation. Covers parsing, custom errors, refinements, type inference, and integration with React Hook Form, Next.js, and tRPC.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzod-validation-expert\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":19},"01M78G4MS3WE96MH5P561KFY95","zipai-optimizer","Adaptive token optimizer: intelligent filtering, surgical output, ambiguity-first, context-window-aware, VCS-aware, MCP-aware.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzipai-optimizer\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":19},"01M78G4GZ0T47C6929V9CVH1AK","zeroize-audit","Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C\u002FC++\u002FRust code handling secrets, keys, passwords, or other sensitive data.","https:\u002F\u002Fgithub.com\u002Fprincepatel04477-web\u002Ftrivoxa-group\u002Fblob\u002Fmaster\u002F.github\u002Fskills\u002Fzeroize-audit\u002FSKILL.md",[],[]]