Skip to content

Textarea

Tag name: <vscode-textarea>

Multi-line text input.

When participating in a form, it supports the :invalid pseudo class. Otherwise the error styles can be applied through the invalid property.

Properties

autocomplete
Nameautocomplete
Attributeautocomplete
Type

'on' | 'off' | undefined

Default

undefined

autofocusreflects
Nameautofocus
Attributeautofocus
Type

boolean

Default

false

cols
Namecols
Attributecols
Type

number | undefined

Default

undefined

defaultValue
NamedefaultValue
Attributedefault-value
Type

string

Default

''

disabledreflects
Namedisabled
Attributedisabled
Type

boolean

Default

false

formreadonly
Nameform
Type

HTMLFormElement | null

invalidreflects
Nameinvalid
Attributeinvalid
Type

boolean

Default

false

label
Namelabel
Type

string

Default

''

maxLength
NamemaxLength
AttributemaxLength
Type

number | undefined

Default

undefined

maxlength
Namemaxlength
Type

number | undefined

Description

Lowercase alias to maxLength

minLength
NameminLength
AttributeminLength
Type

number | undefined

Default

undefined

minlength
Nameminlength
Type

number | undefined

Description

Lowercase alias to minLength

monospacereflects
Namemonospace
Attributemonospace
Type

boolean

Default

false

Description

Use monospace fonts. The font family, weight, size, and color will be the same as set in the VSCode code editor.

name
Namename
Attributename
Type

string | undefined

Default

undefined

placeholder
Nameplaceholder
Attributeplaceholder
Type

string | undefined

Default

undefined

readonlyreflects
Namereadonly
Attributereadonly
Type

boolean

Default

false

requiredreflects
Namerequired
Attributerequired
Type

boolean

Default

false

resize
Nameresize
Attributeresize
Type

'both' | 'horizontal' | 'vertical' | 'none'

Default

'none'

rows
Namerows
Attributerows
Type

number | undefined

Default

undefined

spellcheck
Namespellcheck
Attributespellcheck
Type

boolean

Default

false

validationMessagereadonly
NamevalidationMessage
validityreadonly
Namevalidity
Type

ValidityState

value
Namevalue
Attributevalue
Type

string

versionreadonly
Nameversion
Type

string

Description

VSCode Elements version

willValidatereadonly
NamewillValidate
wrappedElementreadonly
NamewrappedElement
Type

HTMLTextAreaElement

Description

Getter for the inner textarea element if it needs to be accessed for some reason.

Methods

checkValidity() : boolean
NamecheckValidity
reportValidity() : boolean
NamereportValidity

Events

change
Namechange
TypeEvent
input
Nameinput
TypeInputEvent
vsc-changedeprecated
Namevsc-change
TypeCustomEvent
Description
vsc-inputdeprecated
Namevsc-input
TypeCustomEvent
Description

CSS Custom Properties

--vscode-editor-background
Name--vscode-editor-background
--vscode-editor-font-family
Name--vscode-editor-font-family
--vscode-editor-font-size
Name--vscode-editor-font-size
--vscode-editor-font-weight
Name--vscode-editor-font-weight
--vscode-editor-foreground
Name--vscode-editor-foreground
--vscode-editor-inlineValuesForeground
Name--vscode-editor-inlineValuesForeground
--vscode-focusBorder
Name--vscode-focusBorder
--vscode-font-family
Name--vscode-font-family
--vscode-font-size
Name--vscode-font-size
--vscode-font-weight
Name--vscode-font-weight
--vscode-input-placeholderForeground
Name--vscode-input-placeholderForeground
--vscode-scrollbar-shadow
Name--vscode-scrollbar-shadow
--vscode-scrollbarSlider-activeBackground
Name--vscode-scrollbarSlider-activeBackground
--vscode-scrollbarSlider-background
Name--vscode-scrollbarSlider-background
--vscode-scrollbarSlider-hoverBackground
Name--vscode-scrollbarSlider-hoverBackground
--vscode-settings-textInputBackground
Name--vscode-settings-textInputBackground
--vscode-settings-textInputBorder
Name--vscode-settings-textInputBorder
--vscode-settings-textInputForeground
Name--vscode-settings-textInputForeground