# Building the Web UI

You just created the Web Flow that users will be directed to upon starting their Session. Now let's build out the UI that will be contained in that Web Flow, that is to say the **Web Pages**.

This Contact Form Web Flow will include two Web Pages: A Contact Info Web Page and a Thank You Web Page.

### Building the Contact Info Web Page

1. In [Web Flows Builder](https://docs.airkit.ai/?q=web-flow-builder), double click on the recently added Web Flow and rename it to "Contact Form". Similarly, rename the nested Web Page to "Contact Info".

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-f3db14fa182ae5f107ce9c15f506aad157cc4b3c%2Fbuilding-your-first-app-1-v184-0.png?alt=media)

2. Click on the '+' icon next to the "Contact Info" Web Page to add the Web Controls one by one. There are different types of Controls, each serving a specific purpose.&#x20;

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-54d16c174e36b46c6a088c85a20b0b060c775abb%2Fbuilding-your-first-app-1-v184-1.png?alt=media)

<details>

<summary>What are Web Controls?</summary>

**Web Controls**

**Web Controls** are basic UI building blocks that allow users to interact with a web app. They’re things like [Buttons](../../web-controls/button-web-control), [input boxes](../../web-controls/text-input-web-control), and [Progress Bars](../../web-controls/progress-bar-web-control). Much like how Web Pages are the component parts of Web Flows, **Web Controls** are the component parts of Web Pages.

Each **Web Control** is different, because each component part of a Web Page must interact with users in a different way. [Labels](../../web-controls/label-web-control), for instance, only need to be read, where as [Text Input Boxes](../../web-controls/text-input-web-control) must be able to bind user input to a variable that can be called on at some point downstream.

All **Web Controls**:

* Effect the current page UI or functionality. (Most are visual but some act as containers or add invisible functionality to the web application.)
* Use properties to control their style and behavior.
* Are constructed in a "tree" structure that allows controls to contain children controls but always roll up to the page at the top level.

For a deeper dive into individual **Web Controls**, see [the associated reference documents](../../web-controls/button-web-control).

</details>

This Contact Form includes **Input Controls**, which are fields the users will later complete. The Input Controls on this Form are the following:

* Name - Text Input
* Phone - Phone Input
* Email - Email Input
* Company - Text Input

Choose the [Text Input](../../web-controls/text-input-web-control) Control for the “Name” and "Company" fields, as users are expected to enter a text; choose the [Phone Input](../../web-controls/phone-input-web-control) Control for the “Phone” field, as users are expected to enter numbers following a phone format; and choose the [Email Input](../../web-controls/email-input-web-control) Control for the "Email" field.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-231ac883519051849b56dac60f9122d3149c909a%2Fbuilding-your-first-app-1-v184-2.png?alt=media)

<details>

<summary>What is the difference between a Text Input Control, a Phone Input Control, and an Email Input Control?</summary>

**Built-in validation**

The Text Input Control, Phone Input Control, and Email Input Control all accept [strings](../../variable-data-types/the-text-variable-data-type) as user input. (In Airkit, both [Phone](../../variable-data-types/the-phone-variable-data-type) and [Email](https://docs.airkit.ai/?q=email) types are subcategories of Text.) However, while the Text Input Control accepts any and all strings as valid input and binds them to the associated variable, the Phone and Email Input Controls first run a test to confirm that the string the user gave was a properly-formatted phone number or email (respectively) before binding the input to the associated variable. If the string the user gave was not properly formatted, the associated variable will remain `NULL`.

\


Note that while this built-in validation process prevents your Airkit apps from saving inappropriately-formatted data, it does not automatically communicate any part of this validation process to users. If you want to include intuitive error messages in your applications, construct them according to the process outlined in [Validation of Forms and User Data](../../building-apps/working-with-forms-agreements/validation-of-user-data).

</details>

For each Input Control, a [Variable](../../working-with-data/working-with-data-overview/variable-namespaces) is automatically created and binded to the Value of that input.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-ff3c3d594926f85360c9f7e7d2173e82f0f63904%2Fbuilding-your-first-app-1-v184-3.png?alt=media)

3. Once the Controls are added, include a [Label Control](../../web-controls/label-web-control) above each of them to show the user what input they are filling out.&#x20;

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-2aa5dc7e4b15013ad4fd027f9af3fd1b002eb19e%2Fbuilding-your-first-app-1-v184-4.png?alt=media)

To edit the Label, double click on it in the Stage or change the Text property in the Inspector section. You can also change the style of the Label by choosing a Variant.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-c119b23dd8adfa5b708411eef42fe260dfaed213%2Fbuilding-your-first-app-1-v184-5.png?alt=media)

<details>

<summary>What is a Variant?</summary>

**Variants**

A **Variant** is a set of styling properties for a specific Web Control, similar to a class in CSS. If you're not familiar with CSS classes, you might compare Web Controls and Variants to dinnerware. Plates, cups, and forks are all like different web controls: they each have a particular function, and this is reflected in aspects of their appearance. However, not all plates look the same. A square red plate and a round blue plate are both capable of serving as plates and are simply styled differently. If you are deciding whether to set your table with your blue plates or your red plates, this is like choosing between different **Variants** of plates.

Every Web Control has associated **Variants**: cosmetic variations that appear differently but function identically. **Variants** can be edited in [Theme Builder](../../studio/studio/builder-bar/theme-builder) and then used as defaults when adding new Web Controls. For instance, within a single application, you might create two **Variants** of button: a rectangular one in red, and a round one in blue. Any changes made to existing **Variants** also apply retroactively: existing Web Controls previously styled according to the old default will immediately take the form specified by the new default. This allows for consistent branding throughout the entirety of each user's Journey, and it also makes it easy to see how different combinations of colors, fonts, and graphics look together.

</details>

4. Finally, add a [Button Control](../../web-controls/button-web-control). This will be later used to submit data collected from users to AirData.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-817439d21e2bda499c9ffed8c7257a77f25585ef%2Fbuilding-your-first-app-1-v184-6.png?alt=media)

Edit the name by double clicking on it or from the Text in the Inspector section.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-0bd8a097dcef933d044b19eaaab1e381926c430c%2Fbuilding-your-first-app-1-v184-7.png?alt=media)

5. Now that the Form is ready, click on the Web Page to check all the auto-created Variables that will store the input Values. If necessary, rename the Variables so they are easy to identify. For example, change `text_input` to `name_input.`

<figure><img src="https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-2b831f3bdbe541e81e25421eb7cc8c87c213965d%2Fbuilding-your-first-app-1-v184-8.png?alt=media" alt="" width="400"><figcaption></figcaption></figure>

### Building the Thank You Page

Add a Thank You Web Page to the Web Flow for users to see after completing the Form.

1. Click on the '+' icon next to the Web Flow and add the second Web Page. Double click on it to edit the name for a more descriptive one.&#x20;

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-a267719bdfea61062702af431673256a9c878669%2Fbuilding-your-first-app-1-v184-9.png?alt=media)

2. Click on the '+' icon next to the new Web Page to add the Label Control.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-484618b68f1243f23d5369fee3669a21d521ab7b%2Fbuilding-your-first-app-1-v184-10.png?alt=media)

3. Type the message users will see on submitting the Form by editing the Label.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-9596afb12e856bab3df984ce2973787b763a4960%2Fbuilding-your-first-app-1-v184-11.png?alt=media)

You've now built out the complete UI for your form.

### Navigating between web pages

We are going to link an action to our Submit button to display a Thank you message after submitting the contact information.

1. Click on the “Submit” button and go to the Actions tab in the Inspector and Click on the '+' icon. The Actions menu will be displayed.

<figure><img src="https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-89e90271bb03d3abb7d4fa59905a32974a5e3fa9%2Fbuilding-your-first-app-1-v184-12.png?alt=media" alt="" width="400"><figcaption></figcaption></figure>

2. Select the Navigate to Web Page action. Choose the Thank You Web Page so that users are directed there when clicking on the button.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-dbe2cb6577b0b0d3749322c92f4dc875acdb4771%2Fbuilding-your-first-app-1-v184-13.png?alt=media)

3. Save the app and it will be ready to be tested.

### Previewing

1. To **Preview**, click on the Preview Button in the top right hand corner. This will open up a new tab and open up the App Preview.

![](https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-99f3b3680c4bdf3273cf2bd3a2f4e646912e4e91%2Fbuilding-your-first-app-1-v184-14.png?alt=media)

2. Click on the web icon to launch the web experience

<figure><img src="https://2599974655-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FIRF6etABDVMr59RdpyGw%2Fuploads%2Fgit-blob-584fb05c67158ba573438ecb88afe34155cc0b7d%2Fbuilding-your-first-app-1-v184-15.png?alt=media" alt="" width="300"><figcaption></figcaption></figure>

3. You can also open up the state viewers to see the different states of your application

\[block:image] { "images": \[ { "image": \[ "./assets/building-your-first-app-1-v184-16.GIF", null, "" ], "align": "center", "sizing": "400px" } ] } \[/block]

4. Fill out the form and click on Submit, you should be navigated to the next web page!
