Cds accessibility

From coinbase/cds · View interactive version

Cds accessibility is an AI agent skill from the GitHub repository coinbase/cds. Reviews already-written Coinbase Design System (CDS) UI for accessibility: verifying documented accessibility props (e.g. accessibilityLabel, accessibilityState), confirming the chosen CDS primitives cover the right assistive technology behavior, and checking usage against official CDS documentation

How to use this skill

Skill file

cds-accessibility

Use this skill to review CDS UI for accessibility after it has been written: confirm that documented props and patterns from CDS are applied, and that the chosen CDS components have official docs describing the interaction the code needs. Do not use this file as a generic WCAG or ARIA handbook. Whenever you need official CDS documentation, load it with the **cds-docs** skill, which is the single source for current CDS component docs (the official docs site is cds.coinbase.com). Do not guess aria-* or RN prop names from third-party blogs.

When to use

Prerequisites

Success criteria

For a given change, this review is complete when all three dimensions below are true. If any dimension is not met, the review found a gap (or the gap is out of scope for CDS—continue with docs, add verification, or escalate).

1. CDS props for accessibility

2. Component selection (confident and documented)

3. Documentation engagement (read and applied)

| Dimension | The review is complete when |

| ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| Props | In-scope components use doc-correct CDS a11y props and patterns for the platform. Focus-managed components (Step 5) match doc for focus when applicable. |

| Selection | Component choices match documented a11y behavior; composites are used when the doc prescribes them for the interaction, not guessed primitives. |

| Docs | Relevant CDS doc content (loaded via cds-docs) and cross-links are read and reflected in the code; any verification gap is stated. Text/typography semantics align with the Text doc when Text is in scope. |


Part 1: Workflow – what to do

Follow these steps in order when reviewing the accessibility of CDS components in already-written code.

Setup (align platform and **cds-docs**)

  1. Determine whether the code under review is web or mobile (or both). When in doubt, the cds-code setup (package discovery) establishes this; keep platform consistent so you load the right docs.
  2. For each CDS component in the change, plan to load its doc via cds-docs with emphasis on accessibility, props tables, and examples.

You do not need to repeat full setup for every small review; repeat when runtime or major CDS version might have changed.

Step 1: Scope the CDS surface

  1. State whether the work is web or React Native (or both), and load docs for that runtime via cds-docs.
  2. List CDS components in the change. Ignore arbitrary raw HTML unless a CDS pattern in the docs maps to it.
  3. If a feature could use a higher-level CDS component (modal, list, form field) versus composing only Box/View, note it—you will compare docs in Step 3.

Step 2: Pull accessibility-relevant docs per component

For each component in the list:

  1. Load its doc via cds-docs, and also load any sub-routes the doc cross-links (e.g. usage with FormField or Modal).
  2. Read the prop table and any Accessibility, ARIA, Screen reader, or React Native notes. Treat required or strongly recommended label/name props as mandatory for the scenarios the doc describes.

If the doc is thin for your platform, still do not invent a full generic ARIA layer—follow the published doc and, if the gap is blocking, call out that the behavior is not specified in CDS for that component.

Step 3: Check the CDS component choice (accessibility angle)

  1. If multiple CDS components could work, the chosen one should be the one whose documentation describes the right focus management, keyboard, role, and announcements for the interaction (e.g. a documented Modal or Select over a hand-built stack).
  2. Prefer smallest component whose doc fully covers the interaction over a lower primitive plus custom behavior.
  3. Defer to cds-code for overall “which component for layout/visuals”; use this step when assistive technology behavior is the differentiator.

Step 4: Verify documented accessibility APIs

  1. React Native: confirm accessibilityLabel, accessibilityHint, accessibilityState, accessibilityRole, and any other props the CDS component doc names for the use case are set. Do not accept labels copied from old code without re-checking the current prop table.
  2. Web: confirm aria-*, as, role, htmlFor / id / field wiring are used only as the CDS web component API and examples show. Prefer the component’s first-class props (e.g. a dedicated label or slot) over ad hoc ARIA on the wrong element.
  3. For form validation and errors, confirm the CDS form patterns the doc links are used—association and live regions must match the documented approach.
  4. For decorative vs informative icons and images, confirm CDS Icon / Image (or media) guidance in the official CDS doc (loaded via cds-docs) is followed.
  5. For CDS Text and typography, confirm as (web) / accessibilityRole (React Native) per Part 2, Text (typography) and heading semantics and the Text official doc (loaded via cds-docs); skip if the change has no Text (or equivalent) in scope.

Step 5: Focus management (focus-managed components only)

When to run this step: only if the Step 1 component list includes at least one focus-managed CDS component per the published official doc (loaded via cds-docs)—typically overlays and floating UI (examples: Modal, Tray, Tooltip; also drawer, popover, or others only if the doc describes focus movement, trap, initial/restore focus, or keyboard dismiss). If the change is only static layout, inline fields, or components whose docs do not define focus management, skip this step and go to Step 6: Verify.

  1. For each in-scope component, read the official CDS doc (via cds-docs) for focus, keyboard, accessibility, and any ref/method patterns, using the worked examples that match your CDS version.
  2. Confirm the code implements only what the doc specifies: where focus lands on open, how Tab (or platform equivalent) cycles within the surface, how focus restores on close, and dismiss behavior (e.g. Esc) if documented.
  3. Do not assume Tooltip behaves like Modal—hover vs click, aria behavior, and whether focus moves at all are per component doc. Flag any home-grown tabIndex/listener stack when CDS already documents the path.

Step 6: Verify

  1. Doc match: usage matches the examples and prop constraints in the doc you read (including platform-specific snippets).
  2. If the doc or your team’s process expects a device check (e.g. VoiceOver on a build), note that; do not claim “accessible” from code shape alone if the task requires that verification.
  3. When the cds-code flow applies, its visual verification pass still stands; this review does not replace that—it adds CDS a11y API correctness.
  4. If you ran Step 5: for each focus-managed component, confirm open → focus as documented, Tab/keyboard cycle as documented, close → focus restore as documented, and dismiss keys if the doc requires them. If you skipped Step 5, omit this bullet.

Step 7: Final checklist

  1. Definition of done: all items in Success criteria (above) are true for this change—props (including focus for focus-managed components when in scope), component selection, and documentation engagement.
  2. Operational follow-through: if the cds-code workflow was used to build the UI, its visual verification is still in place; this review adds CDS a11y consumption and does not replace layout, styling, or import checks from that skill.

Part 2: Reviewing CDS for accessibility

These patterns are not a substitute for reading each component’s doc. They tell you what to look for in the doc you loaded via cds-docs for the same component.

Doc discipline

Text (typography) and heading semantics

The consumer is responsible for pairing visual font styles on CDS Text with correct assistive names and roles so structure matches the real page or screen. Source of truth: the Text web and mobile official docs (loaded via cds-docs)—not generic HTML heading blogs.

Web (React):

React Native:

React Native (CDS mobile)

Web (CDS web)

Choosing the right component (heuristics)

Forms and errors

Media, icons, and images

Explicit non-goal


Part 3: Reference

CDS resources

Relationship to `cds-code`

Common props: mental map (read the doc, do not hardcode from memory)

| Concern | React Native (see mobile doc) | Web (see web doc) |

| ------------------ | --------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |

| Exposed name | Often accessibilityLabel, sometimes with visible Text | accessibilityLabel (when the web doc lists it for name), then aria-label, aria-labelledby, or label / slot props on the field |

| Hint / description | accessibilityHint where doc allows | aria-describedby or description slots per official CDS web doc (loaded via cds-docs) |

| State | accessibilityState + component state props | aria-* state per component table (aria-expanded, aria-selected, etc.) |

| Role / semantics | accessibilityRole and CDS structural components | as, role, semantic elements in doc examples |

| Form errors | Follow CDS form doc | Follow CDS form doc |

Always fill this table from the current CDS component doc (loaded via cds-docs) for the specific component version you use. The table is a search checklist, not a spec.

Anti-patterns

Where this skill stops

If the official CDS doc (loaded via cds-docs) does not document a behavior you need, do not fabricate a full custom accessibility architecture inside this skill’s name—record the gap, use design/DS follow-up, or external accessibility guidance for non-CDS layers.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.