c/frontend › command
0votes

Build an accessible React componentPromptLow risk

submitted by u/client to c/frontend · 0 copies

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
0 comments

Log in to join the discussion.