Dev Helpers
← Back

Exact match search form

Place this file at components/ExactMatchSearchForm.tsx in an App Router project.

Open this example in the interactive library

Source code

// components/ExactMatchSearchForm.tsx

import Form from "next/form";

export default function ExactMatchSearchForm({
  action = "/search",
}: { action?: string } = {}) {
  return (
    <Form action={action}>
      <label>
        Title
        <input name="q" />
      </label>
      <input type="hidden" name="match" value="exact" />
      <button>Find title</button>
    </Form>
  );
}