c/frontend › command
0votes

Build an accessible React component

PromptLow risk
submitted by CommandVault editors to c/frontend

Get a production-ready component with keyboard support, ARIA and tests.

Prompt · 3 variables
Build a {{component}} component in React + TypeScript for {{use_case}}.

Requirements:
- Fully keyboard operable (Tab, Shift+Tab, Enter, Space, Escape, arrow keys where it makes sense).
- Correct roles and ARIA attributes; no ARIA where native HTML already works.
- Visible focus styles that pass WCAG 2.2 AA contrast.
- Props are typed, documented with JSDoc, and have sensible defaults.
- No external UI libraries. Styling with {{styling}}.

Return: the component file, a short usage example, and a test file (Testing Library) covering keyboard use and screen-reader labels.
0 commentsreport

Try it here

Fill in {{component}}, {{use_case}}, {{styling}} above first for a better answer, or run it as is and the AI will assume sensible values.

or open in ChatGPT · Claude · Perplexity

How to use this prompt

  1. Fill in the 3 blanks above. The more specific you are, the better the answer.
  2. Copy it and paste it into ChatGPT, Claude, Gemini, Cursor or Codex, or use "Try it here" for a quick test.
  3. Read the answer critically: check anything it claims about your code or data before you rely on it.
  • {{component}} Component
  • {{use_case}} Use case
  • {{styling}} Styling

More from c/frontend

See all of c/frontend →
0 comments

Log in to join the discussion.