Version: 3.0.0-next.36

Building a form with Validation

Apps often require users to enter information into a text field. For example, you might require users to log in with an email address and password combination.

To make apps secure and easy to use, check whether the information the user has provided is valid. If the user has correctly filled out the form, process the information. If the user submits incorrect information, display a friendly error message letting them know what went wrong.

In this example, learn how to add validation to a form that has a single text field using the following steps:

  1. Create an Input wrapped in FormControl.
  2. Add validation logic.
  3. Create a button to validate and submit the form.

1. Create an Input wrapped in FormControl.#

Description

2. Add validation logic.#

Description

3. Create a button to validate and submit the form.#

Description

Internal link for Community Integration ( Formik and React Hook Forms ).

Community Integration#

NativeBase can be used with other popular Form libraries like Formik and React Hook Forms as well. For more details checkout Community Integration section of the docs.