A text input allows users to enter any combination of letters, numbers, or symbols. Text input boxes can span single or multiple lines.
When to use
A user needs to input text-based information that is longer or cannot be divided into discrete fields.
Anatomy
1. Label
2. Placeholder
3. Assistive Text
4. Container (required)
Examples
<h2 class="headline-text__md mb-3">Default</h2>
<div class="ucla-field">
<label class="ucla-field__label" for="exampleTextarea">Label</label>
<div class="ucla-field__control">
<textarea
class="ucla-field__textarea"
id="exampleTextarea"
placeholder="Textarea"
aria-describedby="uclaAssistiveTextarea"
></textarea>
</div>
<p class="ucla-field__help" id="uclaAssistiveTextarea">Assistive text goes
here</p>
</div>
<h2 class="headline-text__md mb-3">Warning</h2>
<div class="ucla-field ucla-is-warning">
<label class="ucla-field__label" for="exampleTextareaWarning">Label</label>
<div class="ucla-field__control">
<textarea
class="ucla-field__textarea"
id="exampleTextareaWarning"
placeholder="Textarea"
aria-describedby="uclaWarningTextarea"
></textarea>
</div>
<p class="ucla-field__help" id="uclaWarningTextarea">Assistive text goes here</p>
</div>
<h2 class="headline-text__md mb-3">Error</h2>
<div class="ucla-field ucla-is-error">
<label class="ucla-field__label" for="exampleTextareaError">Label</label>
<div class="ucla-field__control">
<textarea
class="ucla-field__textarea"
id="exampleTextareaError"
placeholder="Textarea"
aria-describedby="uclaErrorTextarea"
></textarea>
</div>
<p class="ucla-field__help" id="uclaErrorTextarea">Assistive text goes here</p>
</div>
<h2 class="headline-text__md mb-3">Disabled</h2>
<div class="ucla-field">
<label class="ucla-field__label" for="exampleTextareaDisabled">Label</label>
<div class="ucla-field__control">
<textarea
class="ucla-field__textarea"
id="exampleTextareaDisabled"
placeholder="Disabled Textarea"
disabled
></textarea>
</div>
</div>
Best Practices
Use placeholders or contextual tips in form fields to help people provide the right data.