Key Features
- Predictive Search: Real-time search results as you type
- Multiple Resource Types: Products, collections, pages, articles, and query suggestions
- Recently Viewed: Shows recently viewed products when search is empty
- Modal & Inline: Supports both modal overlay and inline search
- Keyboard Navigation: Full keyboard support with arrow keys
- Responsive Design: Optimized for mobile and desktop
Search Modes
Modal Search
Full-screen search overlay activated from header:- Opens in dialog modal
- Backdrop overlay
- Close button
- Full-width on mobile
- Constrained width on desktop
Inline Search
Embedded search (disabled by default):Search Button
The search action in the header:Display Styles
- Icon
- Text
Shows magnifying glass icon only.Best for: Minimal headers, mobile
Predictive Search Section
The main search results container:Result Types
Query Suggestions
Search term suggestions from Shopify:- Styled matching text
- Pill-style design
- Click to search for term
- Hover animations
Product Results
Product cards in search results:- Product image
- Product title
- Price
- Variant options (if applicable)
- Add to cart button (optional)
Collection Results
Collection cards with images:Page Results
Content pages matching search:Article Results
Blog posts matching search:Recently Viewed Products
When search input is empty, show recently viewed:- Stores viewed product IDs in localStorage
- Searches for those products by ID
- Reorders results to match view order
- Limits to 4 most recent
Search Results Counter
Accessibility Announcements
No Results State
Single Result Handling
When only one result, provide quick navigation:Animations
Slide-Up Animation
Staggered Delays
Removing Animation
Card Hover Effects
Product Cards
Query Pills
Keyboard Navigation
Arrow Key Support
↑/↓- Navigate resultsEnter- Select resultEsc- Close searchTab- Navigate normally
Focus Styles
Carousel Layout
For collections, pages, and articles:- Horizontal scroll
- Scroll snap
- Arrow navigation on desktop
- Touch-friendly on mobile
Modal Styling
Desktop Modal
Mobile Modal
Input Styling
Schema Configuration
The predictive search section has no configurable settings—behavior is controlled by the search button in the header.
Search Performance
Debouncing
Search queries are debounced to reduce API calls:Caching
Recent searches are cached in memory:Accessibility
ARIA Live Regions
ARIA Live Regions
Listbox Pattern
Listbox Pattern
Focus Management
Focus Management
- Focus moves to search input when modal opens
- Focus returns to trigger button when modal closes
- Focus visible on all interactive elements
- Keyboard shortcuts work globally