Spectrum Components API

Schema version: 6.0.0

Text area

A text area lets a user input a longer amount of text than a standard text field. It can include all of the standard validation options supported by the text field component.

PropertyValuesDefault valueRequired
label
text
-
label position
top / side
top
hide label
yes / no
no
value
text
from minValue to maxValue
-
width
yes / no
nono
size
s / m / l / xl
m
necessity indicator
text / icon
icon
is required
yes / no
no
has character count
yes / no
no
show valid icon
yes / no
no
is error
yes / no
no
is disabled
yes / no
no
hide drag icon
yes / no
no
height
yes / no
nono
help text
text
-
error message
text
-
input type
text / url / phone / email / password
text
state
default / hover / focus + hover / focus + not hover / keyboard focus
default
{
  "slug": "text-area",
  "$schema": "https://opensource.adobe.com/spectrum-design-data/schemas/component.json",
  "$id": "https://opensource.adobe.com/spectrum-design-data/schemas/components/text-area.json",
  "title": "Text area",
  "description": "A text area lets a user input a longer amount of text than a standard text field. It can include all of the standard validation options supported by the text field component.",
  "meta": {
    "category": "inputs",
    "documentationUrl": "https://spectrum.adobe.com/page/text-area/"
  },
  "type": "object",
  "properties": {
    "label": {
      "type": "string"
    },
    "labelPosition": {
      "type": "string",
      "default": "top",
      "enum": [
        "top",
        "side"
      ]
    },
    "hideLabel": {
      "type": "boolean",
      "default": false
    },
    "value": {
      "type": "string",
      "description": "from minValue to maxValue"
    },
    "width": {
      "type": "number"
    },
    "size": {
      "type": "string",
      "enum": [
        "s",
        "m",
        "l",
        "xl"
      ],
      "default": "m"
    },
    "necessityIndicator": {
      "type": "string",
      "enum": [
        "text",
        "icon"
      ],
      "default": "icon"
    },
    "isRequired": {
      "type": "boolean",
      "default": false
    },
    "hasCharacterCount": {
      "type": "boolean",
      "default": false
    },
    "showValidIcon": {
      "type": "boolean",
      "default": false
    },
    "isError": {
      "type": "boolean",
      "default": false
    },
    "isDisabled": {
      "type": "boolean",
      "default": false
    },
    "hideDragIcon": {
      "type": "boolean",
      "default": false
    },
    "height": {
      "type": "number",
      "description": "If undefined, height is dynamic and grows with input text."
    },
    "helpText": {
      "type": "string"
    },
    "errorMessage": {
      "type": "string"
    },
    "inputType": {
      "type": "string",
      "enum": [
        "text",
        "url",
        "phone",
        "email",
        "password"
      ],
      "default": "text"
    },
    "state": {
      "type": "string",
      "enum": [
        "default",
        "hover",
        "focus + hover",
        "focus + not hover",
        "keyboard focus"
      ],
      "default": "default"
    }
  }
}
← Back to home