[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7APQJPQJHHJASXRR1PA33ZB":3,"skill-same:01M7APQJPQJHHJASXRR1PA33ZB":50},{"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":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":6,"ownerHtmlUrl":32,"ownerBlogUrl":33,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7APQJPQJHHJASXRR1PA33ZB","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.","Cyrilthetecchieee\u002Fcyril-code-","Cyrilthetecchieee","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F219787998?v=4","01M7AF0MMMKRAA0H61XMJPV92H","Julian Cyril D ","01M7AF0MQ10AVG6QJQ1C2BC0F5",2,"MIT","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\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.\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","57e7aa6b6e03bce1a7d7862ba9c2ec312f7f19b5","src\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fskills\u002Ffrontend-a11y",0,"https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee","https:\u002F\u002Fwithcyril.me\u002F","Hi, I’m Julian Cyril D, a Computer Science and Business Systems student at PSNACET.\r\nI’m passionate about full-stack development, UI\u002FUX design, and building sma","2026-11-04 23:28:50",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add Cyrilthetecchieee\u002Fcyril-code- --skill frontend-a11y",{"tool":42,"command":43},"bunx","bunx skills add Cyrilthetecchieee\u002Fcyril-code- --skill frontend-a11y",{"tool":45,"command":46},"pnpm","pnpm dlx skills add Cyrilthetecchieee\u002Fcyril-code- --skill frontend-a11y","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fskills\u002Ffrontend-a11y\u002FSKILL.md",true,[],[51,60,67,75,82,89],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":56,"sourceHtmlUrl":57,"categories":58,"keywords":59,"publishedAt":19},"01M7AQV6CYX8RMC78420V9WZ62","webapp-testing","Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.","Apache-2.0","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fwebapp-testing\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fwebapp-testing\u002FSKILL.md",[],[],{"skillNo":61,"name":62,"nameZh":6,"description":63,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":64,"categories":65,"keywords":66,"publishedAt":19},"01M7AQV2895N3S1MEX6K76G6G2","youtube-downloader","Download YouTube videos with customizable quality and format options. Use this skill when the user asks to download, save, or grab YouTube videos. Supports various quality settings (best, 1080p, 720p, 480p, 360p), multiple formats (mp4, webm, mkv), and audio-only downloads as MP3.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fvideo-downloader\u002FSKILL.md",[],[],{"skillNo":68,"name":69,"nameZh":6,"description":70,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":71,"sourceHtmlUrl":72,"categories":73,"keywords":74,"publishedAt":19},"01M7AQTRNX62DNKVZ5GXEHRBKB","theme-factory","Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors\u002Ffonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftheme-factory\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftheme-factory\u002FSKILL.md",[],[],{"skillNo":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"publishedAt":19},"01M7AQTNNVHAAN9H6DA8T6ZVE0","template-skill","Replace with description of the skill and when Claude should use it.","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftemplate-skill\u002FSKILL.md",[],[],{"skillNo":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"publishedAt":19},"01M7AQTJ3MQ6AKX152MEX2MYCC","tailored-resume-generator","Analyzes job descriptions and generates tailored resumes that highlight relevant experience, skills, and achievements to maximize interview chances","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Ftailored-resume-generator\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":55,"licenseFileUrl":93,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":19},"01M7AQTD7D5MYET2YWG7HG9WM3","slack-gif-creator","Toolkit for creating animated GIFs optimized for Slack, with validators for size constraints and composable animation primitives. This skill applies when users request animated GIFs or emoji animations for Slack from descriptions like \"make me a GIF for Slack of X doing Y\".","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fslack-gif-creator\u002FLICENSE.txt","https:\u002F\u002Fgithub.com\u002FCyrilthetecchieee\u002Fcyril-code-\u002Fblob\u002Fmain\u002Fsrc\u002Fcyril_code\u002Fassets\u002F.skills_repo\u002Fslack-gif-creator\u002FSKILL.md",[],[]]