Form

Hydrogen has simple form fields and form fields with validation. Examples are listed below.

Simple Form Fields

You can use .field-required class in the lable of the input element to add required styles. Also, don't forget to add required attribute to the input element. .w-100 class makes the input element 100% width of the parent element.

Form with validation style

Here .row class makes the field to be in one line. You need to add novalidate attirbute to the form element. Also, you can use your own error and success message.

Looks Good!
Please enter you name
Looks Good!
Enter correct email
Looks Good!
You must agree before submitting

JavaScript Code