Skip to main content

Search

The useSearch hook provides full-text product search against the Shopify Storefront API. Unlike other listing hooks, useSearch does not fetch on mount. Instead, it exposes a search function you call in response to user input.

Usage

Hook API

Debouncing

For real-time search as the user types, debounce the input before calling search:

Query Scope

The SEARCH_PRODUCTS GraphQL operation searches across product title, description, tags, productType, and vendor fields. Results are returned as a standard GraphQL connection with the same shape as useProducts — each edge contains the full product node with id, title, handle, description, priceRange, images(first: 1), and variants(first: 1).