PromptWebsite buildingOutput shown

Responsive component spec with accessibility

Before writing code, write what the component must do on every screen.

What you get

You should get a written spec first: layout at phone, tablet and desktop widths, every state (default, hover, focus, empty, error), keyboard use, screen-reader labels and the data needed. Then you get the component itself using semantic HTML and CSS variables. Reading the spec before the code lets you catch a wrong idea early. Empty and error states are the ones people forget.

Example output (illustration of the shape of a result, not a recorded test)

Phone: one column, cards stacked. Desktop: three columns. Focus: 2px outline. Keyboard: Tab moves between plans. Screen reader: each plan is a labelled group.
<section aria-labelledby="plans">...

How to use it

  1. Scroll to the end of this page and copy the prompt.
  2. Replace each [bracket] with your real product, audience and facts.
  3. Check every claim in the answer against your own facts before it goes on a page.

Fill in these fields

Change only the parts in [brackets]. The rest of the wording keeps the answer on task.

FieldWhat to enter
[component]Your own details. Example: pricing table
[framework]Your own details.

Change it for your case

  • For a different framework, name it and ask for the idiomatic version.
  • If you have a design system, paste its token names and ask the model to use only those.
  • For a form, add 'show the error message wording for each field'.

Tips

  • Ask for the states list first. Empty and error states are the ones people forget.

The prompt

Copy it, then fill in the [brackets]. We have not tested this prompt; we call a prompt tested only when a test result is shown.

Specify a [component, e.g. pricing table] for a [framework] site.
Cover: layout at phone, tablet and desktop widths; the states (default, hover, focus, empty, error); keyboard use; screen-reader labels; and the data it needs.
Then write the component using semantic HTML and CSS variables, no inline colours.