Textarea

Multi-line inputs used by users to enter longer text portions.

Classes

ClassDescriptionParentModifies
.s-textareaBase textarea style.N/AN/A
.s-textarea__smApply a small size.N/A.s-textarea
.s-textarea__lgApply a large size.N/A.s-textarea

Base style

<div class="d-flex fd-column gy4">
    <label class="s-label" for="example-item">Question body</label>
    <div class="d-flex ps-relative">
        <textarea class="s-textarea w100" id="example-item" placeholder="…"></textarea>
    </div>
</div>

Accessibility

It is recommended to follow the same accessibility guidance as the Input component. Including marking Textarea’s as required via the .s-required-symbol class.

Validation states

Validation states provides the user feedback based on their interaction (or lack of interaction) with a textarea. These styles are applied by applying the appropriate class to the wrapping parent container.

Validation classes

ClassDescriptionApplies to
.has-warningUsed to warn users that the value they've entered has a potential problem, but it doesn't block them from proceeding.Parent element
.has-errorUsed to alert users that the value they've entered is incorrect, not filled in, or has a problem which will block them from proceeding.Parent element
.has-successUsed to notify users that the value they've entered is fine or has been submitted successfully.Parent element

Validation examples

Warning

<div class="s-form-group has-warning">
    <label class="s-label" for="example-warning">Description</label>
    <div class="d-flex ps-relative">
        <textarea class="s-textarea w100" id="example-warning" placeholder="Please describe your problem"></textarea>
        <svg class="svg-icon s-input-icon" aria-hidden="true"></svg>
    </div>
    <p class="s-input-message">Consider entering a description to help us better help you.</p>
</div>

Consider entering a description to help us better help you.

Error

<div class="s-form-group has-error">
    <label class="s-label" for="example-error">Description</label>
    <div class="d-flex ps-relative">
        <textarea class="s-textarea w100" id="example-error" placeholder="Please describe your problem"></textarea>
        <svg class="svg-icon s-input-icon" aria-hidden="true"></svg>
    </div>
    <p class="s-input-message">A description must be provided.</p>
</div>

A description must be provided.

Success

<div class="s-form-group has-success">
    <label class="s-label" for="example-success">Description</label>
    <div class="d-flex ps-relative">
        <textarea class="s-textarea w100" id="example-success" placeholder="Please describe your problem"></textarea>
        <svg class="svg-icon s-input-icon" aria-hidden="true"></svg>
    </div>
    <p class="s-input-message">Thanks for providing a description.</p>
</div>

Thanks for providing a description.

Sizes

ClassNameSizeExample
.s-textarea__smSmall13px
N/ADefault14px
.s-textarea__lgLarge18px