Form
Form<
Schema>(props):Element
A Form collects information from a user.

Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
Schema extends ZodObject<any, UnknownKeysParam, ZodTypeAny, object, object> |
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
props | FormProps<Schema> & object |
Returns
Section titled “Returns”Element
Example
Section titled “Example”import { Form, FormField, FormFieldSecret } from "@netlify/sdk/ui/react/components";
<Form onSubmit={(fields) => console.log("Form submitted.", { fields })}> <FormField name="name" label="Your Name" required /> <FormFieldSecret name="deepest_secret" label="Your Deepest Secret" required /> <FormField name="explanation" label="An Explanation" type="textarea" /> <FormField type="number" name="id_number" label="Your Serial Number" /></Form>