next-static-search
next-static-search

next-static-search

Instant, offline, zero-backend search for statically exported Next.js sites.

Try it

Search the three guide pages of this demo. Press ⌘K / Ctrl K, or type below. The index is built by the Pagefind CLI after next build — it is a static file, so there is no server involved.

Try install, styling or config.

Pages in this demo

Usage

tsx
import { NextStaticSearch } from "next-static-search";import "next-static-search/style.css";
export function Nav() {  return <NextStaticSearch searchBoxType="modal" />;}

Then index the export, after next build:

tsx
npx pagefind --site out --output-path out/_next/static/pagefind