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 label="Message" placeholder="Enter your message"></dap-ds-textarea>
    <dap-ds-textarea size="lg" label="Message" placeholder="Enter your message"></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'
Slots
NameDescription
feedback-iconThe custom icon of the feedback.
Attributes
PropertyTypeDefaultDescription
size'sm' 'lg'The size of the textarea. Default is md. Can be sm or lg.
disabledbooleanfalseThe disabled state of the textarea.
maxlengthnumber The maximum length of the textarea.
minlengthnumber The minimum length of the textarea.
hideCounterbooleanfalseHide character counter.
rowsnumber 6The number of rows in the textarea.
colsnumber The number of columns in the textarea.
valuestringThe value of the textarea.
placeholderstring''The placeholder 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.
wrap'hard' 'soft'Indicates how the control should wrap the value for form submission. Can be hard or soft.
feedbackstringThe feedback of the textarea.
feedbackType'info' 'success' 'error'The feedback type of the textarea. Can be info, success, or error.
optionalbooleanThe optional state of the textarea.
optionalLabelstringThe optional label of the textarea.
subtlebooleanThe weight of the label. Default is false
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.