Skip to main content

Form

Form is a simple wrapper around the html <form /> element that automatically adds an onSubmit handler as well as handling the rendering of global / non-blocking errors.

This component is not required, however using it is recommended because the browser has default behaviour when using both a <form id='formName /> element and a <button type='submit' form='formName' />. When using these props, pressing enter on any <input /> within the form will automatically submit (if there is only one <form /> and one <button /> the name and form props can be omitted).

NameTypeDefaultDescription
namestringundefinedThe name of the form, mapped to the <form /> id and can be used to automatically add auto-submit functionality to a form
FormErrorComponentType<any>DefaultFormErrorThe component that will be rendered when there are any globalErrors or nonBlockingErrors