Open this example in the interactive library
Source code
// components/ProductAvailabilityEnquiry.tsx
import Form from "next/form";
export default function ProductAvailabilityEnquiry({
slug = "desk-lamp",
name = "Desk lamp",
}: { slug?: string; name?: string } = {}) {
return (
<Form action="/availability">
<input type="hidden" name="product" value={slug} />
<label>
Postal code
<input name="postal" required />
</label>
<button>Check pickup for {name}</button>
</Form>
);
}
