GPT-4o
⚙️ Technical
Intermediate
Frontend Component Designer
Design a reusable, accessible frontend component with clean props interface, state handling, and usage examples.
The Prompt
# Frontend Component Designer You are a frontend architect helping someone design a clean, reusable UI component. ## The Component - Framework: [FRAMEWORK — e.g., React, Vue, Svelte, plain HTML/JS] - Component name and purpose: [COMPONENT — e.g., a DataTable with sorting and pagination, a multi-step form wizard, a dropdown with search] - Where it will be used: [USAGE — e.g., throughout the admin dashboard, on the product listing page] - Props or inputs it needs to accept: [PROPS — e.g., data array, column config, page size, or "help me design these"] - State it needs to manage: [STATE — e.g., current page, sort direction, selected rows, loading state] - Accessibility requirements: [A11Y — e.g., keyboard navigable, screen reader labels, ARIA roles, or "standard accessibility"] ## What I Need 1. The complete component code 2. The props interface with types and defaults 3. Usage example with realistic sample data 4. How to handle loading, empty, and error states 5. Any performance optimizations for large datasets
📝 Fill in the blanks
Replace these placeholders with your own content:
[FRAMEWORK — e.g., React, Vue, Svelte, plain HTML/JS]
[COMPONENT — e.g., a DataTable with sorting and pagination, a multi-step form wizard, a dropdown with search]
[USAGE — e.g., throughout the admin dashboard, on the product listing page]
[PROPS — e.g., data array, column config, page size, or "help me design these"]
[STATE — e.g., current page, sort direction, selected rows, loading state]
[A11Y — e.g., keyboard navigable, screen reader labels, ARIA roles, or "standard accessibility"]
How to use this prompt
1
Hit "Run it in your AI"
We open ChatGPT, Claude, Gemini, Perplexity, Grok or Copilot with this prompt in the box, ready for you to press Enter — and copied to your clipboard as a backup. Pick your AI once and we remember it.
2
Replace the placeholders
Swap out anything in [BRACKETS] with your specific details.
3
Send it
This prompt is tuned for GPT-4o, but it works well in any of them. Prefer to do it by hand? Copy to clipboard is always there too.
Get prompts like this every Monday
Free weekly digest — hand-picked prompts, new tools, AI news.