Skip to content

Textarea Component

A textarea component.

Properties

NameTypeDefaultDescription
valuestring''The value of the textarea.
disabledbooleanfalseIndicates whether the textarea is disabled.
errorbooleanfalseIndicates whether the textarea has an error.
captionstring''The caption text for the textarea.
labelstring''The label for the textarea.
namestring''The name of the textarea.
placeholderstring''The placeholder text for the textarea.

CSS Parts

NameDescription
fieldThe main container for the textarea.
labelThe label for the input.
containerThe container for the input.
inputThe input element.
captionThe caption for the textarea.

Check this link to learn how to use CSS parts for Textarea Component.

CSS Properties

TokenDefaultDescription
--tap-font-family--tap-sys-font-familyThe font family used in the input.
--tap-input-field-gap--tap-sys-spacing-4The gap between the elements in the input.
--tap-input-label-color--tap-sys-color-content-primaryThe color of the label.
--tap-input-label-line-height--tap-sys-typography-label-sm-heightThe line height of the label.
--tap-input-label-font-size--tap-sys-typography-label-sm-sizeThe font size of the label.
--tap-input-label-font-weight--tap-sys-typography-label-sm-weightThe font weight of the label.
--tap-input-caption-color--tap-sys-color-content-tertiaryThe color of the caption.
--tap-input-caption-line-height--tap-sys-typography-body-sm-heightThe line height of the caption.
--tap-input-caption-font-size--tap-sys-typography-body-sm-sizeThe font size of the caption.
--tap-input-caption-font-weight--tap-sys-typography-body-sm-weightThe font weight of the caption.
--tap-input-container-height--tap-sys-spacing-11The height of the container.
--tap-input-container-padding--tap-sys-spacing-6The padding inside the container.
--tap-input-container-gap--tap-sys-spacing-4The gap between elements in the container.
--tap-input-container-background-color--tap-sys-color-surface-tertiaryThe background color of the container.
--tap-input-container-border-radius--tap-sys-radius-3The border radius of the container.
--tap-input-focus-background-color--tap-sys-color-surface-secondaryThe background color of the container when focused.
--tap-input-focus-border-width--tap-sys-color-border-inverse-primaryThe border width of the container when focused.
--tap-textarea-input-color--tap-sys-color-content-primaryThe color of the input text.
--tap-textarea-input-line-height--tap-sys-typography-body-md-heightThe line height of the input text.
--tap-textarea-input-font-size--tap-sys-typography-body-md-sizeThe font size of the input text.
--tap-textarea-input-font-weight--tap-sys-typography-body-md-weightThe font weight of the input text.
--tap-textarea-input-placeholder-color--tap-sys-color-content-tertiaryThe color of the placeholder text.
--tap-textarea-input-placeholder-line-height--tap-sys-typography-body-md-heightThe line height of the placeholder text.
--tap-textarea-input-placeholder-font-size--tap-sys-typography-body-md-sizeThe font size of the placeholder text.
--tap-textarea-input-placeholder-font-weight--tap-sys-typography-body-md-weightThe font weight of the placeholder text.
--tap-input-error-caption-color--tap-sys-color-content-negativeThe color of the caption when there is an error.
--tap-input-error-container-background-color--tap-sys-color-surface-negative-lightThe background color of the container when there is an error.
--tap-input-error-container-border-color--tap-sys-color-border-negativeThe border color of the container when there is an error.
--tap-input-disabled-container-background-color--tap-sys-color-surface-disabledThe background color of the container when disabled.
--tap-input-disabled-container-color--tap-sys-color-content-disabledThe color of the text and elements when disabled.
--tap-input-caret-color--tap-sys-color-surface-accentThe color of the input caret.