A responsive UI prompt defines the behavior that must survive width and content changes. Pair a few representative viewport widths with the states most likely to break: a long label, no records, loading, a request error, keyboard focus, and an open menu. Require natural reflow, reachable actions, readable text, and no horizontal clipping at the chosen widths. The widths are test fixtures, not promises that every device has that exact size. A state matrix makes the review finite: test each high-risk combination and explain why lower-risk combinations are covered by the same layout rule.
Responsive UI prompts: test states, not one viewport
Operational case
On the Dispatch Queue page, the 47-row All state fills a desktop list, while a narrow phone width compresses the filter and one long destination label. The Held view has 6 rows. An empty search has a specific message and a clear action; a failed request shows retry rather than the empty message. The matrix checks wide All, narrow Held with long text, narrow empty, and narrow error with keyboard focus on Retry. It also checks that the count remains tied to the filtered data. A prompt that says 'make responsive' without these conditions could pass while the filter disappears off-screen.
Wide + All: 47 visible; count 47; columns readable.
Narrow + Held: 6 visible; long destination wraps; filter reachable.
Narrow + empty: zero matches message; clear filter action.
Narrow + request error: retry control; no false zero count.
Keyboard: filter and retry have visible focus in reading order.Performance and operating cost
A full Cartesian test of V viewports and S states has O(VS) cases. Select a small set that covers distinct layout rules and failure transitions, then add cases when a regression exposes a new boundary. Browser automation and screenshots cost more than a static prompt, so run cheap state assertions before costly pixel comparisons. The content and interaction contract should remain valid if the design's exact breakpoint changes.
Common Mistakes
- Do not lock every dimension to the source screenshot's pixels.
- Do not treat an error as an empty result to simplify the state table.
- Do not omit long content or keyboard focus from the narrow-width check.
Connected lessons
- Prompt engineering applications
- Prompt Engineering
- Responsive CSS: keep reading order and controls usable
- Accessible output evaluations: measure failures by artifact and user task
- Generated tests: verify the oracle before trusting coverage
- UI prompts: turn a brief into components and states
- Screenshot prompts: separate pixels from behavior
- UI code prompts: reuse tokens and components with a change gate
- UI release prompts: compare appearance and verify access
- Project: implement and review a dispatch queue UI
- UI-to-code prompt decisions
