[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CTV9VM7YC5WVZ2Y72A0KAX":3,"skill-same:01M7CTV9VM7YC5WVZ2Y72A0KAX":49},{"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":27,"commitSha":28,"skillDirectory":29,"forksCount":14,"repositoryHtmlUrl":30,"repositoryHomepageUrl":6,"ownerHtmlUrl":31,"ownerBlogUrl":32,"ownerDescription":33,"updatedAt":34,"install":35,"resources":48},"01M7CTV9VM7YC5WVZ2Y72A0KAX","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.","Henrique1601\u002FSkiilsToIAs","Henrique1601","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F92006691?v=4","01M7CRXVT0GVXVK80JT1GR687S","Henrique Bezerra Dos Santos","01M7CRXVTN5Y8TMWJ1MDSKCQ1T",0,"MIT","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fdevelopment\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.\nmetadata:\n  origin: 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> 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> 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,"metadata":24,"description":26},{"origin":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","main","a73152352c0612252131e5cf84e91312a6cf17dc","development\u002Ffrontend-a11y","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs","https:\u002F\u002Fgithub.com\u002FHenrique1601","https:\u002F\u002Fbezerraportifolio.netlify.app\u002F","Full Stack Developer | React, Next.js, TypeScript, Node.js & IA | Construindo produtos digitais e soluções SaaS","2026-11-15 02:56:04",{"source":8,"skillName":5,"commands":36,"prompt":46,"zipAvailable":47},[37,40,43],{"tool":38,"command":39},"npx","npx skills add Henrique1601\u002FSkiilsToIAs --skill frontend-a11y",{"tool":41,"command":42},"bunx","bunx skills add Henrique1601\u002FSkiilsToIAs --skill frontend-a11y",{"tool":44,"command":45},"pnpm","pnpm dlx skills add Henrique1601\u002FSkiilsToIAs --skill frontend-a11y","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fdevelopment\u002Ffrontend-a11y\u002FSKILL.md",true,[],[50,57,64,72,79,86],{"skillNo":51,"name":52,"nameZh":6,"description":53,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":54,"categories":55,"keywords":56,"publishedAt":19},"01M7E2ANBW9V6AVX5JXNCEAWF8","rag-architect-agent","Agente Arquiteto de RAG, Embeddings & Busca Vetorial. Especialista em design e implementação de pipelines de Retrieval-Augmented Generation de alta fidelidade: chunking semântico, modelagem pgvector no PostgreSQL (Neon\u002FSupabase), busca híbrida (cosseno + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fcustom-agents\u002Frag-architect-agent\u002FSKILL.md",[],[],{"skillNo":58,"name":59,"nameZh":6,"description":60,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":61,"categories":62,"keywords":63,"publishedAt":19},"01M7E29KKF8R02ZRGYE2MJM67G","rag-architecture-patterns","Padrões arquiteturais e implementação de pipelines RAG (Retrieval-Augmented Generation) de alta fidelidade para qualquer projeto ou sistema. Cobre chunking semântico, embeddings, busca híbrida (pgvector + BM25), reranking, validação via TypeSafe AI e filosofia Ponytail (anti-overengineering).","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Fai-agents\u002Frag-architecture-patterns\u002FSKILL.md",[],[],{"skillNo":65,"name":66,"nameZh":6,"description":67,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":68,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CWRA8E3BJ7CPY8N8EG28J1","skill-repair","Use this to fix and re-install agent skills that have failed installation.\nThis skill provides the necessary context and permissions to surgically update\nthe `manifest.json` after a fix has been applied.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fskill-repair\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CWR66FZP8FA47WVZ4Z2EXC","security-scan","Scan your Claude Code configuration (.claude\u002F directory) for security vulnerabilities, misconfigurations, and injection risks using AgentShield. Checks CLAUDE.md, settings.json, MCP servers, hooks, and agent definitions.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-scan\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CWR0QPY58QPTR1P759TFNG","security-review","Use this skill when adding authentication, handling user input, working with secrets, creating API endpoints, or implementing payment\u002Fsensitive features. Provides comprehensive security checklist and patterns.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-review\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CWQXCE40XWT4FZ3VWZFGDP","security-bounty-hunter","Hunt for exploitable, bounty-worthy security issues in repositories. Focuses on remotely reachable vulnerabilities that qualify for real reports instead of noisy local-only findings.","https:\u002F\u002Fgithub.com\u002FHenrique1601\u002FSkiilsToIAs\u002Fblob\u002Fmain\u002Futilities\u002Fsecurity-bounty-hunter\u002FSKILL.md",[],[]]