Text field

Text fields components are used for collecting user provided information.

Usage

A simple text-field with placeholder and/or label.


API

v-text-field

Supplemental

Mask legend
MaskDescription
Masks
#Any digit
AAny capital letter
aAny small letter
NAny capital alphanumeric character
nAny small alphanumeric character
XAny special symbol (-!$%^&*()_+|~=`{}[]:";'<>?,./\) or space
Pre-made
credit-card#### - #### - #### - ####
date-with-time##/##/#### ##:##
phone(###) ### - ####
social###-##-####
time##:##
time-with-seconds##:##:##

Examples

Single line light theme

Single line text-fields do not float their label on focus or with data.


With Icon

Icons can be specified as prepended or appended.


Character counter

Use a counter to inform a user of the character limit. The counter does not perform any validation by itself. You will need to pair it with either the internal validation system, or a 3rd party library.


Password input

A password input can be used with an appended icon and callback to control the visibility.


Validation

Vuetify includes simple validation through the rules prop. The prop accepts an array of callbacks. While validating rules, the current v-model value will be passed to the callback. This callback should return either true or a String, the error message.


Full-width text field with character counter

Full width text fields allow you to create boundless inputs. In this example, we use a v-divider to separate the fields.


Required fields

In this example two of the text-fields are required. We utilize the required prop in order to apply an asterisk to the label and rules to validate the fields.


Hint text

The hint property on text-fields adds the provided string beneath the text-field. Using persistent-hint keeps the hint visible when the text-field is not focused.


Prefixes & suffixes

The prefix and suffix property allows you to prepend and append inline non-modifiable text next to the text-field


Custom validation

While the built in v-form or 3rd party plugin such as vuelidate or vee-validation can help streamline your validation process, you can choose to simply control it yourself.


Box style

Text-fields can be used with an alternative box design. Append and prepend icon props are not supported in this mode.


Solo style

Text-fields can be used with an alternative solo design.


Custom colors

You can optionally change a text-field into any color in the Material design palette. Below is an example implementation of a custom form with validation.


Masks

Text fields can validate against character masks. Using either a pre-made or custom rules, you can optionally format and validate specific character sets.


Progress bar

You can display a progress bar instead of the bottom line. You can use the default indeterminate progress having same color as the text field or designate a custom one using the progress slot