Community程式設計與開發github.com

accessibility

Build and review interfaces against WCAG 2.2 AA - native elements first, keyboard paths, visible focus, focus trapping and restoring, hit areas, labels and forms, error announcements, accessible names, contrast thresholds, reduced motion, timers, live regions, alt text, zoom and reflow - for web (Tailwind) and React Native. Use when building any interactive UI, forms, dialogs, menus or custom widgets, or when auditing accessibility.

accessibility 是什麼?

accessibility is a Claude Code agent skill that build and review interfaces against WCAG 2.2 AA - native elements first, keyboard paths, visible focus, focus trapping and restoring, hit areas, labels and forms, error announcements, accessible names, contrast thresholds, reduced motion, timers, live regions, alt text, zoom and reflow - for web (Tailwind) and React Native. Use when building any interactive UI, forms, dialogs, menus or custom widgets, or when auditing accessibility.

相容平台~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/manishdashsharma/ui-ux-skills/tree/HEAD/skills/accessibility

Installed? Explore more 程式設計與開發 skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

在你喜歡的 AI 中提問

開啟一個已預先載入此 Agent Skill 的新對話。

說明文件

accessibility 是做什麼的?

Two walks: keyboard-only (every flow completes without a pointer), then screen reader (every control announces name, role and state). When unsure, take the platform default over a custom rebuild, and remove ARIA rather than add it. A finding cites a WCAG 2.2 A/AA criterion or a concrete task an assistive-tech user can't complete; everything else is a recommendation.

Native first

  • <button> for actions, <a href> for navigation (Cmd/middle-click must work), never <div onClick>.
  • Use the primitive library (shadcn/Base UI/Radix) for dialogs, menus, selects, comboboxes — focus management and key maps come free.
  • Native: Pressable with accessibilityRole="button" and accessibilityLabel; accessibilityState={{ selected, disabled, checked }}.

Focus

  • focus-visible: rings, not bare focus:. A custom ring reaches 3:1 against what it crosses: focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent. Never outline-none without a replacement.
  • Focused elements never hide under sticky chrome (scroll-pt-*).
  • Dialogs: <dialog> with showModal() or the primitive; background inert, focus moves in on open and returns to the trigger on close; Escape closes.
  • Client-side route change: update document.title, move focus to the new <h1> or <main>.
  • tabIndex only 0 or -1. Composite widgets use roving tabindex or aria-activedescendant.

Keyboard

Every pointer interaction has a keyboard path: Escape closes overlays, arrows move inside composite widgets, Tab moves between widgets, Enter/Space activate. Every drag has a single-pointer alternative (buttons or a menu that move the item) (2.5.7).

Targets

24×24 CSS px minimum (2.5.8); aim for 44×44 on touch, 40×40 on desktop. Extend invisibly with a pseudo-element (relative after:absolute after:-inset-2) or hitSlop on native. Extended areas never overlap; decorative layers get pointer-events-none.

Forms

  • Every input has a <label>. Placeholder is never a label. Label and control share one hit target.
  • autocomplete, name, type, inputmode on every field about the user. Never block paste.
  • Validate on submit (and on blur for format), never by disabling submit until valid. Mark aria-invalid="true", point aria-describedby at the inline error, focus the first invalid field.
  • Known requirements shown as helper text before input.

Names and announcements

  • Icon-only buttons: aria-label naming the action ("Delete project"), and the visible label text must appear in the accessible name.
  • Decorative elements aria-hidden="true" (never on something focusable). Decorative images alt=""; informative images describe meaning; functional images describe the action.
  • aria-describedby for field errors; a polite live region (role="status", rendered empty first) for toasts and result counts; role="alert" only for urgent untied errors.
  • Native: AccessibilityInfo.announceForAccessibility for status changes.

Color and contrast

CriterionApplies toMinimum
1.4.3Text4.5:1
1.4.3Large text (≥ 24px or ≥ 18.67px bold)3:1
1.4.11UI boundaries, states, meaningful graphics3:1

Status never by color alone (1.4.1). Measure with color-system.

Motion and time

  • Movement, scale and blur are opt-in under motion-safe:; under reduced motion use opacity cross-fades; kill parallax and autoplay. Native: useReducedMotion().
  • Moving or auto-updating content lasting > 5s gets a pause control (2.2.2). Toasts with actions or errors stay until dismissed.
  • A state change carried by motion alone must leave a color, icon or label behind.

Structure and zoom

  • Headings form a coherent outline; one <main>; a "Skip to content" link when navigation precedes it. Set lang.
  • Text survives 200% resize (1.4.4); reflow at 320px without horizontal scroll (1.4.10). Never maximum-scale=1.
  • Native: layouts survive the largest Dynamic Type size.

Escalation triggers (always HIGH)

Unnamed interactive control · no visible focus · pointer-only path · motion ignoring reduced motion · clipped/unreachable at 320px or 200% · failing text contrast · meaning by color alone · destructive action with no confirm/undo · truncated content with no way to the full value · error with no recovery path.

Before you finish

PatternFix
outline-none with no focus-visible replacementrestore a ring
<div onClick><button> / <a href>
role="button" without key handlingnative element
positive tabIndexfix DOM order
disabled={!isValid} on submitvalidate on submit
region mounted together with its messagerender empty region first
aria-live="assertive" on a success toastrole="status"
<img> with no altalt="" or describe purpose
tooltip on a natively disabled controltext beside it or aria-disabled
drag with no button alternativeadd one

Verification: with a browser, tab the flow, read names/roles from the accessibility tree, run an automated audit (axe). Report what you couldn't run as Not verified.

Individual skills in this repo

This repo contains 4 individual skills — each has its own dedicated page.

color-system

Build and audit color - OKLCH ramps, semantic role tokens in Tailwind, light and dark themes, one-meaning-per-color, contrast measured on the rendered pair, gradients and P3. Use when picking or generating a palette, naming color tokens, adding dark mode, fixing contrast, or when components use raw hex or bg-blue-600 directly.

create-ui

Build a complete frontend from a product description — web app, landing page, dashboard or Expo/React Native mobile app — in one consistent flow - scope screens → direction (wait for OK) → Tailwind and tokens → components → every state → motion pass → review → verify in browser or iOS simulator. Use when the user asks to build, create or design an app, site, page set or set of screens (for example "build an iOS app like X with Expo", "make a dashboard for Y", "build the frontend for this PRD").

design-direction

Decide what a product should look and feel like before building it — ground the design in the subject, write a five-line direction, plan tokens (palette, type, layout, motion), check the plan against the usual AI defaults, and lock it in DESIGN.md. Uses the user's references, design system, Mobbin/inspiration tools or theme presets when given. Use at the start of any new app, page, screen set or redesign, when the user pastes references or a design system link, asks to "match this vibe", or says the UI looks generic.

typography

Set and review how text renders - choosing typefaces, a role-based type scale as Tailwind tokens, line-height and tracking by size, measure, wrapping, truncation, tabular numbers, punctuation, font loading and size floors, on web and native. Use when picking fonts, defining a type scale, fixing text that looks off, or reviewing headings, labels, numbers and long-form text.

相關技能