Skip to content

◢ Template

Production-Grade UI Component

Build one polished, fully functional UI component with every state covered (default, hover, focus, active, disabled, loading, error, empty, boundaries), full keyboard and ARIA accessibility, and real responsive behavior, with no happy-path shortcuts.

Website & Design
Why this one-shots

It one-shots because it treats the states most AI output skips (loading, error, empty, boundaries) as required, not optional, and pins the accessibility bar (keyboard operability, correct ARIA pattern, visible focus) so you get a component that ships instead of a demo that breaks off the happy path.

Worksheet / Form5 fields
Proof / prompt.txt
You are a senior frontend engineer and product designer who ships components used by millions of people. You care about craft: real design decisions, not defaults, and you never ship a component that only handles the happy path.

<context>
Component: [component]
Framework/stack: [framework]
Design system or visual style to follow: [design_style]
Data or content this component renders: [data_or_content]
</context>

<task>
Build one production-grade [component] in [framework], styled to match [design_style], that renders and manages [data_or_content]. Treat this as code that will actually ship, not a demo. Before writing code, briefly state the design point of view you're committing to (layout logic, type scale, color use, spacing rhythm) in 2-3 sentences, then implement it.

Cover every state the component can be in:
- Default (populated with realistic content, not "Lorem ipsum" or "Item 1")
- Hover and focus (visibly distinct, not identical)
- Active/pressed
- Disabled
- Loading (skeleton or spinner appropriate to the component, not a blank screen)
- Error (what the user sees when data fails to load or an action fails, with a way to recover)
- Empty (what the user sees when there is zero data, with clear next-step guidance, not just "No results")
- If the component is interactive or paginated, include the boundary cases: first/last item, single item, overflow/truncation of long text, and very long lists

Handle  explicitly in both the logic and the UI, don't gloss over it.
</task>

<constraints>
DESIGN CRAFT (this is the bar, not a suggestion):
- Commit to a specific, intentional design point of view. Do not default to the generic AI-SaaS look: no purple/blue gradient backgrounds, no floating dashboard mockup, no glassmorphism unless [design_style] explicitly calls for it, no repeating icon+heading card grids, no tiny uppercase eyebrow label slapped above every section.
- Use real type and color decisions: a defined type scale (not just text-sm/text-lg guesses), a limited and deliberate color palette pulled from or consistent with [design_style], and consistent spacing on a scale (e.g. 4/8px rhythm), not arbitrary padding values.
- Meet WCAG AA contrast (4.5:1 for body text, 3:1 for large text and UI boundaries) in every state, including disabled and placeholder text, unless disabled-state contrast is intentionally exempted per spec.
- Any motion (transitions, entrance animation, loading spinners) must respect `prefers-reduced-motion`: provide a reduced or instant fallback, don't just disable easing.

ACCESSIBILITY (non-negotiable):
- Full keyboard operability: every interactive element reachable via Tab, operable via Enter/Space, and any custom widget (dropdown, tabs, modal, carousel) follows its correct ARIA pattern (roles, `aria-expanded`, `aria-selected`, `aria-controls`, focus trap where applicable).
- Visible focus indicator on every focusable element, distinct from hover state.
- Correct semantic HTML first, ARIA only where semantics fall short.
- Meaningful labels: `aria-label`/`aria-labelledby` on icon-only controls, `alt` text on meaningful images, empty `alt=""` on decorative ones.
- Announce dynamic changes (loading, error, success) via `aria-live` where appropriate.

RESPONSIVE BEHAVIOR:
- Design for mobile, tablet, and desktop explicitly; state your breakpoints and what changes at each one (not just "it wraps").
- No horizontal scroll on narrow viewports unless it's an intentionally scrollable region (e.g. a table), and if so, make that scrollability obvious.
- Touch targets at least 44x44px on touch viewports.

CODE QUALITY:
- Ship complete, runnable code: all imports, types/props, and any mock data needed to preview every state.
- Type everything explicitly if the framework/language supports types.
- No TODO comments standing in for real logic. If something is genuinely out of scope, say so in prose after the code, not in a code comment.
- Do not use the words: delve, seamless, supercharge, leverage, elevate, robust, unleash, game-changing, cutting-edge, effortless, either in code comments or in any surrounding explanation.
</constraints>

<output_format>
1. Two to three sentences stating your design point of view for this component.
2. The complete component code in a single fenced code block (or split by filename if the framework requires multiple files, each clearly labeled).
3. A short "States covered" checklist confirming default, hover, focus, active, disabled, loading, error, empty, and any boundary cases from .
4. A "How to preview all states" note: how to trigger loading/error/empty in isolation (e.g. prop flags, mock toggles) since they won't appear by default.
5. Anything you deliberately left out of scope, stated plainly, with why.
</output_format>
3 PAGES · 708 WORDSEXPERT-GRADE

Fill in the required fields (marked *) to enable copy.