Forms are the standard way to receive user inputted data. The transitions and smoothness of these elements are very important because of the inherent user interaction associated with forms.

Input Fields

Text fields allow user input. The border should light up simply and clearly indicating which field the user is currently editing. You must have a .input-fielddiv wrapping your input and label. This helps our jQuery animate the label. This is only used in our Input and Textarea form elements.

The validate class leverages HTML5 validation and will add a validand invalidclass accordingly. If you don't want the Green and Red validation states, just remove the validate class from your inputs.


This is an inline input field:

Prefilling Text Inputs

If you are having trouble with the labels overlapping prefilled content, Try adding class="active" to the label.
You can also call the function M.updateTextFields(); to reinitialize all the Materialize labels on the page if you are dynamically adding inputs.

Icon Prefixes

You can add an icon prefix to make the form input label even more clear. Just add an icon with the class prefix before the input and label.


account_circle
phone

Custom Error or Success Messages

You can add custom validation messages by adding either data-error or data-success attributes to your input field labels.


Helper Text

Textarea

Textareas allow larger expandable user input. The border should light up simply and clearly indicating which field the user is currently editing. You must have a .input-field div wrapping your input and label. This helps our jQuery animate the label. This is only used in our Input and Textarea form elements.

Textareas will auto resize to the text inside.

Icon Prefixes

You can add an icon prefix to make the form input label even more clear. Just add an icon with the class prefix before the input and label.


mode_edit

Select

Select allows user input through specified options. Make sure you wrap it in a .input-field for proper alignment with other text fields. Remember that this is a jQuery plugin so make sure you initialize this in your document ready.

Disabled Styles

You can also add disabled to the select element to make the whole thing disabled. Or if you add disabled to the options, the individual options will be unselectable.

Radio Buttons

Radio Buttons are used when the user must make only one selection out of a group of items. The for attribute is necessary to bind our custom radio button with the input. Add the input's idas the value of the forattribute of the label.

Add radio buttons to a group by adding the name attribute along with the same corresponding value for each of the radio buttons in the group. Create disabled radio buttons by adding the disabled attribute as shown below.

Options

To create a radio button with a gap,add class="with-gap"to your input. See the example below.

Checkboxes

Use checkboxes when looking for yes or no answers. The forattribute is necessary to bind our custom checkbox with the input. Add the input's id as the value of the for attribute of the label.

Switches

Use checkboxes when looking for yes or no answers. The for attribute is necessary to bind our custom checkbox with the input. Add the input's idas the value of the forattribute of the label.

File Input

If you want to style an input button with a path input we provide this structure.

File

Multiple File Input

You can also use the multipleattribute to allow multiple file uploads.

File

Add a range slider for values with a wide range. This one is set to be a number between 0 and 100. We have two different types of sliders. nouiSlider is a 3rd party plugin which we've modified. To use the noUiSlider, you will have to manually link the nouislider.css and nouislider.js files located in the extras folder.

noUiSlider

See noUiSlider's official documentation hereto see a variety of slider options

20
80

HTML5 Range

Date Picker

We use a modified version of pickadate.js to create a materialized date picker. Test it out below!

Time Picker

We use a modified version of pickatime.js to create a materialized time picker. Test it out below!

Auto Complete

textsms

Character Counter