5.1.1 Text View in a new window
The standard input[type="text"]
element, with a label and help text.
Display indication for :valid and :invalid states. Drupal uses the class .error for invalid inputs so we'll use that.
Twig: form/input/input-text.twig
Default example
Help text that provides additional information about the field.
Indication that the text field with required input is valid
Help text that provides additional information about the field.
Indication that the text field with required input is invalid
Help text that provides additional information about the field.
Markup
<div class="form__item">
<label for="inputText" class="label--required">Input text field</label>
<input type="text" id="inputText" aria-describedby="inputTextHelp" class="{{ modifier_class }}" required>
<div role="tooltip" id="inputTextHelp" class="form__description">Help text that provides additional information about the field.</div>
</div>