wowprompt

React component from a UI description with accessible markup

Builds one React component in TypeScript from a plain description of the UI, with keyboard support, ARIA where needed, mobile-first styles and a usage example. Use it for modals, tabs, dropdowns, forms and other components that are easy to build and easy to make inaccessible.

A typed React component file, a props table, a usage example, a list of keyboard interactions and an accessibility checklist marked pass or fail
The output this prompt produced, unedited.

The prompt

Fill in these first

  • Component: [e.g. tabs, modal dialog, accordion, combobox, image carousel]
  • What it shows and does: [describe the behaviour and states]
  • Props it needs: [list or describe]
  • Styling approach: [CSS modules, Tailwind, plain CSS, styled-components]
  • React version and framework: [e.g. React 19 with Next.js]
  • Libraries allowed: [none, or list]

Task

Write the component so it works with a mouse, a keyboard and a screen reader, and is laid out for a 360px screen first.

Output format

  1. The component file in one code block, TypeScript with strict types.
  2. Styles in a second code block, mobile-first with min-width breakpoints only.
  3. | Prop | Type | Required | Default | Description |
  4. Usage example.
  5. Keyboard interactions: | Key | Action |
  6. Accessibility checklist: focus visible, focus trap or return where relevant, labels, roles, states announced, colour contrast.

Rules

  • Use native HTML elements first; add ARIA only where no native element fits.
  • No inline event handlers on non-interactive elements.
  • No external libraries unless allowed in the inputs.
  • Comments explain non-obvious behaviour only.
  • Respect reduced motion for any animation.

Example

| Key | Action | | Escape | Closes the dialog and returns focus to the button that opened it |

react componenttypescript reactaccessible componentaria attributeskeyboard navigationfrontend component

How to run this

Copy the prompt and paste it into Gemini, then set the aspect ratio to 3:4. No reference photo is needed for this one.

The prompt is written in Markdown with each part under its own heading, which is what the copy action hands over. Change one section at a time, keeping the rest intact, so you can tell which change did the work.

Related prompts

All productivity