A GET search form produces a shareable query string. Give the input a name and ensure the results page understands an empty search.
Worked example
// components/SearchRouteForm.tsx
import Form from "next/form";
export default function SearchRouteForm({
action = "/search",
}: { action?: string } = {}) {
return (
<Form action={action}>
<label>
Keywords
<input name="q" type="search" required />
</label>
<button>Search</button>
</Form>
);
}Implementation notes
The URL is the durable state of a GET search. Initialize the visible field from that URL so back navigation and page reloads preserve the search.
Try it yourself
Submit accented text and reopen the copied results URL.
Open the Next.js example →Editorial date January 7, 2026 · Published December 6, 2026