2.0.0
Textareas allow a user to input multiple lines of text.
See Forms for guidance on composing full forms.
Use when soliciting multiple lines of text.
<textarea class="mds-form__textarea"></textarea>
<textarea class="mds-form__textarea" disabled></textarea>
<textarea class="mds-form__textarea" placeholder="Tell us more here..."></textarea>
Sizing affects textarea size, text size and internal spacing. The default size is medium, and you can use a modifier class to make the textarea smaller (mds-form__textarea--small
) or larger (mds-form__textarea--large
).
<textarea class="mds-form__textarea mds-form__textarea--small" id="small-textarea" placeholder="Textarea"></textarea>
focus
. This is default behavior and a known issue, teams are still encouraged to use textareas in production.aria-describedby
attribute on each textarea
that has an .mds-form__microcopy
or an .mds-form__field-error
component providing additional information. The value of the aria-describedby
attribute must match the id
attribute on the .mds-form__microcopy
or .mds-form__field-error
component.for
attribute on each label
with a value matching the id
attribute on the corresponding textarea
.mds-form__field-group
container.<div class="mds-form__field-group">
<label class="mds-form__label" for="comments">Comments</label>
<textarea class="mds-form__textarea" id="comments"></textarea>
</div>
box-shadow
property to create an outline. Internet Explorer and Safari have known issues rendering these outlines when using the browser's zoom functionality. This visual defect doesn't affect the functionality of the component.
Class |
Applies to |
Outcome |
---|---|---|
|
|
Adjusts styling to render a small textarea. |
|
|
Adjusts styling to render a large textarea. |