---
title: "Search hooks for React and Next.js"
slug: "search-hooks-for-react-and-next-js"
abstract: "Learn more about the Search hooks available for Content SDK's React and Next.js packages that enable searching with pagination and infinite scrolling."
---
# Search hooks for React and Next.js

Sitecore's `@sitecore-content-sdk/react` and `@sitecore-content-sdk/nextjs` packages provide hooks to execute search queries with pagination, infinite scrolling, and typeahead suggestions. The hooks available are:

- [`useSearch`](https://doc.sitecore.com/sai/en/developers/content-sdk/20/usesearch.html) - use for pagination with page numbers
- [`useInfiniteSearch`](https://doc.sitecore.com/sai/en/developers/content-sdk/20/useinfinitesearch.html) - use for infinite scrolling with *load more* functionality
- [`useSuggest`](https://doc.sitecore.com/sai/en/developers/content-sdk/20/usesuggest.html) - use for typeahead suggestions and preview results as a user types

`useSearch` and `useInfiniteSearch` also support More Like This (MLT) queries via `seedItemId` and `seedItemUrl`.

All three hooks support generic types for type-safe results and are automatically integrated to SitecoreAI via the `SitecoreProvider`.

## Prerequisites

Before using these hooks, ensure that your application is wrapped using the `SitecoreProvider`. This allows the hooks to access required configuration from the `SitecoreProvider` context.

```ts
import { SitecoreProvider } from '@sitecore-content-sdk/nextjs';

function App() {
  return (
    <SitecoreProvider>
      {/* Your app components */}
    </SitecoreProvider>
  );
}
```