Textarea

Textarea component is a form element which allows the user to input multiple lines of text.

Design system docs

Examples Default Textarea
<dap-ds-textarea
  label="Message"
  description="This is a description"
  placeholder="Enter your message"
></dap-ds-textarea>
Sizes

The textarea component comes in three sizes: small, and large. The default size is sm.

<dap-ds-stack direction="row">
  <dap-ds-textarea
    size="xs"
    label="Message"
    placeholder="Enter your message"
    feedback="This is a feedback message"
    feedbackType="negative"
  ></dap-ds-textarea>
  <dap-ds-textarea
    label="Message"
    placeholder="Enter your message"
    feedback="This is a feedback message"
    feedbackType="negative"
  ></dap-ds-textarea>
  <dap-ds-textarea
    size="lg"
    label="Message"
    placeholder="Enter your message"
    feedback="This is a feedback message"
    feedbackType="negative"
  ></dap-ds-textarea>
</dap-ds-stack>
Statuses

The textarea component comes in three statuses: default, success, and error. The default status is default.

<dap-ds-stack direction="row">
  <dap-ds-textarea disabled label="Message" placeholder="Disabled"></dap-ds-textarea>
  <dap-ds-textarea readonly value="Readonly" label="Message" placeholder="Read only"></dap-ds-textarea>
  <dap-ds-textarea status="success" label="Message" placeholder="Success"></dap-ds-textarea>
  <dap-ds-textarea status="error" label="Message" placeholder="Error"
    feedback="This is an error message"
    feedbackType="negative"
  ></dap-ds-textarea>
</dap-ds-stack>
Importing
import { DapDSTextarea } from 'dap-design-system/dist/dds'
Importing React
import { DapDSTextareaReact } from 'dap-design-system/dist/react'
Attributes
PropertyTypeDefaultDescription
hideCounterbooleanfalseHide character counter.
minlengthnumberThe minimum length of the textarea.
maxlengthnumber, undefinedThe maximum length of the textarea.
rowsnumber, undefined6The number of rows in the textarea.
colsnumber, undefinedThe number of columns in the textarea.
placeholderstring''The placeholder of the textarea.
wrap'hard', 'soft'Indicates how the control should wrap the value for form submission.
size'xs', 'sm' , 'lg'The size of the textarea. Default is md.
disabledbooleanThe disabled state of the textarea.
valuestringThe value of the textarea.
tooltipstringThe tooltip of the textarea.
tooltipPlacement'top', 'right' , 'bottom' , 'left'The tooltip placement of the textarea.
statusInputStatusThe status of the textarea. Can be success or error.
readonlybooleanThe readonly state of the textarea.
requiredbooleanThe required state of the textarea.
labelstringThe label of the textarea.
descriptionstringThe description of the textarea.
feedbackstringThe feedback of the textarea.
feedbackType'negative', 'positive' , 'warning'The feedback type of the textarea. Can be negative, positive, or warning.
optionalbooleanThe optional state of the textarea.
optionalLabelstringThe optional label of the textarea.
subtlebooleanThe weight of the label. Default is false
autofocusbooleanThe autofocus state of the textarea.
Slots
NameDescription
feedback-iconThe custom icon of the feedback.
Events
Event NameDescription
dds-count-changeFires when the count of the textarea changes.
dds-changeFired when the textarea value changes.
dds-inputFired when the textarea value changes.
dds-keydownFired when a key is pressed down.
dds-blurFired when the textarea loses focus.
dds-focusEmitted when the textarea gains focus.
dds-selectEmitted when select text in textarea.
CSS Parts
Part NameDescription
baseThe main textarea container.
inputThe native input of the textarea.
counterThe counter of the textarea.
counter-baseThe base of the counter.
feedbackThe feedback of the textarea.