Skip to main content

Claude/ChatGPT Prompt to Build E-Commerce Search & Filter UI

Generate a complete e-commerce search and filter UI: faceted filters, instant results, auto-suggest, color swatches, and zero-result recovery.

Fill in the placeholders

Edit the values, then copy your finished prompt.

Your Prompt
prompt.txt
Design a search and filter system for fashion e-commerce with 10,000+ products.

Filter facets needed: category, price range, color, size, brand, rating, availability, material
Search features: auto-suggest, typo tolerance, synonym matching, recent searches

**Industry Design Rules (E-Commerce Search):**
- Pattern: Search bar prominent, filters sidebar (desktop) / bottom sheet (mobile), instant results update
- Style Priority: Speed, discoverability, zero-result recovery — users who search convert 2-3x more
- Color Mood: Neutral filters, highlighted active state, clear selection indicators
- Typography: Scannable product titles, prominent pricing, filter labels with counts
- Key Effects: Instant filter updating (no page reload), search auto-suggest with product thumbnails, filter pill badges
- Anti-Patterns: DO NOT require clicking "Apply" for filters (instant update is expected). NO hiding the result count. NO dead-end zero-results pages (show suggestions). NO tiny filter checkboxes on mobile.

Generate:
1. **Search bar** — auto-suggest with recent searches, popular searches, product thumbnails, category suggestions
2. **Filter sidebar** — 8 faceted filters with: checkboxes, range sliders (price), color swatches, size buttons
3. **Active filters** — pill badges above results with individual remove and "Clear all"
4. **Results grid** — toggle grid/list view, sort options, result count, pagination/infinite scroll
5. **Zero results** — helpful suggestions, related categories, spell-check, "Did you mean?"
6. **Mobile experience** — bottom sheet filters, horizontal filter chips, sticky search
7. **React + Algolia/Meilisearch + Tailwind code** for the filter sidebar with instant results updating

What this prompt does

This prompt generates a complete search and filter UI system by encoding real e-commerce UX constraints directly into the template rather than leaving them for the AI to guess. The "Industry Design Rules" block inside the template acts as an opinionated spec: it mandates instant filter updates, prohibits dead-end zero-results pages, and enforces mobile-first patterns like bottom sheet filters and sticky search — so the AI cannot produce a "click Apply to filter" relic from 2012.

The seven-section output structure is deliberate. Auto-suggest, active filter pills, zero-results recovery, and mobile experience are each their own generation target, which forces the AI to treat them as first-class concerns rather than afterthoughts. You get runnable [framework] code for the filter sidebar alongside the visual spec — closing the gap between design and implementation in a single pass.

The result count and "Clear all" patterns are explicitly required by the template, which matters because these are the two UI elements most commonly dropped by generalist AI outputs. Users who search on an e-commerce site convert significantly higher than browsers, so precision here is worth the prompt length.

When to use it

  • Scaffolding the search and filter layer for a new Shopify, WooCommerce, or headless commerce build before frontend dev starts.
  • Generating a React or Vue filter sidebar component spec when you have the facets defined but no time to design interaction states from scratch.
  • Presenting a filterable product catalog prototype to a client for UX sign-off before writing a line of production code.
  • Rebuilding an underperforming category page where analytics show users abandoning after one or zero filter interactions.
  • Creating a mobile-optimized filter experience for a store where mobile traffic exceeds 60% but the current filter UX is a desktop carry-over.
  • Designing the zero-results recovery flow when a store has a large, inconsistent product catalog prone to dead-end searches.

Example output

For a [store_type] of "outdoor gear", [product_count] of 4,200, and [framework] of React:

Search bar: Combobox with debounced fetch (300ms), thumbnail + price in dropdown rows,
  "Recent: hiking boots, rain jacket" persisted to localStorage, category pills below input.

Filter sidebar (React):
  <PriceRangeSlider min={0} max={800} step={10} onChange={applyInstant} />
  <ColorSwatch options={["Olive","Navy","Red"]} selected={activeColors} />
  <CheckboxGroup label="Brand (142)" options={brands} onChange={applyInstant} />
  <SizeButtonGroup sizes={["XS","S","M","L","XL"]} />

Active filters: <FilterPill label="Under $150" onRemove={...} /> <ClearAll />

Zero-results: "No results for 'gortex jacket' — did you mean Gore-Tex jacket?
  Try: Waterproof Jackets (312), Rain Gear (87)"

Pro tips

  • Set [facets] precisely — vague inputs like "the usual filters" produce generic checkboxes. List actual facet names: Brand, Price, Color, Material, Rating, In Stock. The AI maps them to the right control type (swatch vs. range slider vs. checkbox) only when names are specific.
  • For [framework], go narrow: React with Zustand or Vue 3 Composition API beats just React. The generated code quality jumps when state management is named.
  • Use [facet_count] to control sidebar density. 4–6 facets produces a clean sidebar; 10+ often triggers accordion collapsing behavior in the output — useful for dense catalogs, but set it intentionally rather than letting it happen by default.
  • Pair this prompt with a color/brand prompt to fill in the neutral filter palette. The template deliberately leaves filter colors neutral by design rule, so you will need a second pass if you want branded active states.
  • If the store has guided selling needs (e.g., "Help me choose"), the current template does not include a recommendation flow — add it explicitly to the seven output sections rather than hoping the AI infers it.

Frequently Asked Questions

Does the prompt produce actual frontend code or just a design spec?
Both, in a single output. Section 7 of the template explicitly requests `[framework]` code for the filter sidebar with instant results updating. The other six sections cover design spec, interaction states, and copy. You control the code quality by being specific in `[framework]` — name the framework and state management library together.
What should I put in the `[search_features]` variable?
List the specific behaviors you need: `auto-suggest with thumbnails, recent searches, spell-check, category disambiguation`. If you leave it vague the AI defaults to a basic text input. The template already mandates auto-suggest patterns, but `[search_features]` lets you add store-specific needs like barcode scanning, voice search, or synonym handling.
Will this work for a store with a small catalog, say under 100 products?
Yes, but tune `[product_count]` accurately — it affects the output in meaningful ways. A 60-product store does not need infinite scroll or complex pagination, and a well-prompted AI will typically simplify those sections when the count is low. Also reduce `[facet_count]` to 2–3 to avoid generating a filter sidebar heavier than the catalog it serves.
Engr Mejba Ahmed

Need this built for real?

Engr Mejba Ahmed

AI Developer · Software Engineer

I'm Mejba — I design and ship production AI systems, automations, and full-stack apps. If you want this turned into a working solution for your team, let's talk.

More in E-commerce UI Prompts

Engr Mejba Ahmed

Engr Mejba Ahmed

AI assistant · trained on my work

👋

Hey there!

Quick Actions

WhatsApp Direct line to me

Chat on WhatsApp

+880 1723 741224 · Replies within the hour on working days

Popular Questions

Engr Mejba Ahmed is connected
Engr Mejba Ahmed is typing...
Engr Mejba Ahmed avatar

✉ Want me to follow up? Drop your email

Engr Mejba Ahmed avatar

📞 Connect Directly

Choose how you'd like to reach me

WhatsApp

+880 1723 741224

Email

mejba.13@gmail.com

✓ Details sent! I'll get back to you shortly.

Powered by OpenAI

335+

Blog Posts

25

AI Courses

63

Projects

Services & Expertise

Pricing & Process

Learning & Resources

Connect & Support