Installation
Install the package and its peer dependencies, then add the Pagefind CLI as a dev dependency. Pagefind indexes the exported HTML, so it runs after the Next.js build rather than during it.
npm install next-static-searchnpm install -D pagefind
The component requires React 17 or newer and works with both the App Router and the Pages Router, as long as the site is statically exported.