Textfield
Tag name: <vscode-textfield>
A simple inline textfield
When participating in a form, it supports the :invalid pseudo class. Otherwise the error styles
can be applied through the invalid property.
Properties
autocomplete
| Name | autocomplete |
|---|---|
| Attribute | autocomplete |
| Type |
|
| Default |
|
autofocusreflects
| Name | autofocus |
|---|---|
| Attribute | autofocus |
| Type |
|
| Default |
|
defaultValue
| Name | defaultValue |
|---|---|
| Attribute | default-value |
| Type |
|
| Default |
|
disabledreflects
| Name | disabled |
|---|---|
| Attribute | disabled |
| Type |
|
| Default |
|
focusedreflects
| Name | focused |
|---|---|
| Attribute | focused |
| Type |
|
| Default |
|
formreadonly
| Name | form |
|---|---|
| Type |
|
invalidreflects
| Name | invalid |
|---|---|
| Attribute | invalid |
| Type |
|
| Default |
|
| Description | Set error styles on the component. This is only intended to apply styles when custom error validation is implemented. To check whether the component is valid, use the checkValidity method. |
max
| Name | max |
|---|---|
| Attribute | max |
| Type |
|
| Default |
|
maxLength
| Name | maxLength |
|---|---|
| Attribute | maxLength |
| Type |
|
| Default |
|
maxlength
| Name | maxlength |
|---|---|
| Type |
|
| Description | Lowercase alias to maxLength |
min
| Name | min |
|---|---|
| Attribute | min |
| Type |
|
| Default |
|
minLength
| Name | minLength |
|---|---|
| Attribute | minLength |
| Type |
|
| Default |
|
minlength
| Name | minlength |
|---|---|
| Type |
|
| Description | Lowercase alias to minLength |
multiplereflects
| Name | multiple |
|---|---|
| Attribute | multiple |
| Type |
|
| Default |
|
namereflects
| Name | name |
|---|---|
| Attribute | name |
| Type |
|
| Default |
|
pattern
| Name | pattern |
|---|---|
| Attribute | pattern |
| Type |
|
| Default |
|
| Description | Specifies a regular expression the form control's value should match. MDN Reference |
placeholder
| Name | placeholder |
|---|---|
| Attribute | placeholder |
| Type |
|
| Default |
|
readonlyreflects
| Name | readonly |
|---|---|
| Attribute | readonly |
| Type |
|
| Default |
|
requiredreflects
| Name | required |
|---|---|
| Attribute | required |
| Type |
|
| Default |
|
step
| Name | step |
|---|---|
| Attribute | step |
| Type |
|
| Default |
|
typereflects
| Name | type |
|---|---|
| Attribute | type |
| Type |
|
| Description | Same as the |
validationMessagereadonly
| Name | validationMessage |
|---|
validityreadonly
| Name | validity |
|---|---|
| Type |
|
value
| Name | value |
|---|---|
| Attribute | value |
| Type |
|
versionreadonly
| Name | version |
|---|---|
| Type |
|
| Description | VSCode Elements version |
willValidatereadonly
| Name | willValidate |
|---|
wrappedElementreadonly
| Name | wrappedElement |
|---|---|
| Type |
|
Methods
checkValidity()
: boolean
| Name | checkValidity |
|---|---|
| Description | Check the component's validity state when built-in validation is used.
Built-in validation is triggered when any validation-related attribute is set. Validation-related
attributes are: |
reportValidity()
| Name | reportValidity |
|---|
Events
change
| Name | change |
|---|---|
| Type | Event |
input
| Name | input |
|---|---|
| Type | InputEvent |
Slots
content-after
| Description | A slot after the editable area but inside of the component. It is used to place icons. |
|---|
content-before
| Description | A slot before the editable area but inside of the component. It is used to place icons. |
|---|
CSS Custom Properties
--vscode-button-background
| Name | --vscode-button-background |
|---|---|
| Default value | #0078d4 |
--vscode-button-foreground
| Name | --vscode-button-foreground |
|---|---|
| Default value | #ffffff |
--vscode-button-hoverBackground
| Name | --vscode-button-hoverBackground |
|---|---|
| Default value | #026ec1 |
--vscode-focusBorder
| Name | --vscode-focusBorder |
|---|---|
| Default value | #0078d4 |
--vscode-font-family
| Name | --vscode-font-family |
|---|---|
| Default value | sans-serif |
| Description | A sans-serif font type depends on the host OS. |
--vscode-font-size
| Name | --vscode-font-size |
|---|---|
| Default value | 13px |
--vscode-font-weight
| Name | --vscode-font-weight |
|---|---|
| Default value | normal |
--vscode-input-placeholderForeground
| Name | --vscode-input-placeholderForeground |
|---|---|
| Default value | #989898 |
--vscode-inputValidation-errorBackground
| Name | --vscode-inputValidation-errorBackground |
|---|---|
| Default value | #5a1d1d |
--vscode-inputValidation-errorBorder
| Name | --vscode-inputValidation-errorBorder |
|---|---|
| Default value | #be1100 |
--vscode-settings-textInputBackground
| Name | --vscode-settings-textInputBackground |
|---|---|
| Default value | #313131 |
--vscode-settings-textInputBackground
| Name | --vscode-settings-textInputBackground |
|---|---|
| Default value | #313131 |
--vscode-settings-textInputBorder
| Name | --vscode-settings-textInputBorder |
|---|---|
| Default value | var(--vscode-settings-textInputBackground, #3c3c3c) |
--vscode-settings-textInputForeground
| Name | --vscode-settings-textInputForeground |
|---|---|
| Default value | #cccccc |