Skip to content

Form

Props

API reference for Form. For usage examples, see the React tab.

NameTypeDefault
actionstring | ((formData: FormData) => void | Promise<void>)

Where to send the form-data when the form is submitted. See MDN (opens in new tab).

childrenReactNode

The children of the component.

compactboolean
encType"application/x-www-form-urlencoded" | "multipart/form-data" | "text/plain"

The enctype attribute specifies how the form-data should be encoded when submitting it to the server. See MDN (opens in new tab).

method"dialog" | "get" | "post"

The HTTP method to submit the form with. See MDN (opens in new tab).

target"_blank" | "_parent" | "_self" | "_top"

The target attribute specifies a name or a keyword that indicates where to display the response that is received after submitting the form. See MDN (opens in new tab).

validationErrorsValidationErrors

Validation errors for the form, typically returned by a server. This should be set to an object mapping from input names to errors.