Open this example in the interactive library
Source code
// 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>
);
}
