Checkbox
Tag name: <vscode-checkbox>
Allows users to select one or more options from a set. When participating in a form, it supports
the :invalid pseudo class. Otherwise the error styles can be applied through the invalid
property.
Properties
autofocusreflects
| Name | autofocus |
|---|---|
| Attribute | autofocus |
| Type |
|
| Default |
|
| Description | Automatically focus on the element when the page loads. |
checkedreflects
| Name | checked |
|---|---|
| Attribute | checked |
| Type |
|
defaultCheckedreflects
| Name | defaultChecked |
|---|---|
| Attribute | default-checked |
| Type |
|
| Default |
|
| Description | The element's initial checked state, which will be restored when the containing form is reset. |
disabledreflects
| Name | disabled |
|---|---|
| Attribute | disabled |
| Type |
|
| Default |
|
focusedreflects
| Name | focused |
|---|---|
| Attribute | focused |
| Type |
|
| Default |
|
formreadonly
| Name | form |
|---|---|
| Type |
|
indeterminatereflects
| Name | indeterminate |
|---|---|
| Attribute | indeterminate |
| Type |
|
| Default |
|
invalidreflects
| Name | invalid |
|---|---|
| Attribute | invalid |
| Type |
|
| Default |
|
label
| Name | label |
|---|---|
| Attribute | label |
| Type |
|
| Description | Label text. It is only applied if component's innerHTML doesn't contain any text. |
namereflects
| Name | name |
|---|---|
| Attribute | name |
| Type |
|
| Default |
|
requiredreflects
| Name | required |
|---|---|
| Attribute | required |
togglereflects
| Name | toggle |
|---|---|
| Attribute | toggle |
| Type |
|
| Default |
|
| Description | When true, renders as a toggle switch instead of a checkbox. |
validationMessagereadonly
| Name | validationMessage |
|---|---|
| Type |
|
validityreadonly
| Name | validity |
|---|---|
| Type |
|
value
| Name | value |
|---|---|
| Attribute | value |
| Type |
|
| Default |
|
| Description | Associate a value to the checkbox. According to the native checkbox specification, If the component participates in a form:
|
versionreadonly
| Name | version |
|---|---|
| Type |
|
| Description | VSCode Elements version |
willValidatereadonly
| Name | willValidate |
|---|---|
| Type |
|
Methods
checkValidity()
: boolean
| Name | checkValidity |
|---|---|
| Description | Returns |
reportValidity()
: boolean
| Name | reportValidity |
|---|---|
| Description | Returns |
Events
change
| Name | change |
|---|---|
| Type | Event |
| Description | Dispatched when checked state is changed. The event is bubbled, so it can be listened on a parent element like the |
invalid
| Name | invalid |
|---|---|
| Type | Event |
| Description | Dispatched when the element is invalid and |
CSS Custom Properties
--vscode-focusBorder
| Name | --vscode-focusBorder |
|---|---|
| Default value | #0078d4 |
--vscode-font-family
| Name | --vscode-font-family |
|---|---|
| Default value | sans-serif |
--vscode-font-size
| Name | --vscode-font-size |
|---|---|
| Default value | 13px |
--vscode-font-weight
| Name | --vscode-font-weight |
|---|---|
| Default value | normal |
--vscode-foreground
| Name | --vscode-foreground |
|---|---|
| Default value | #cccccc |
--vscode-inputValidation-errorBackground
| Name | --vscode-inputValidation-errorBackground |
|---|---|
| Default value | #5a1d1d |
--vscode-inputValidation-errorBorder
| Name | --vscode-inputValidation-errorBorder |
|---|---|
| Default value | #be1100 |
--vscode-settings-checkboxBackground
| Name | --vscode-settings-checkboxBackground |
|---|---|
| Default value | #313131 |
--vscode-settings-checkboxBorder
| Name | --vscode-settings-checkboxBorder |
|---|---|
| Default value | #3c3c3c |
--vscode-settings-checkboxForeground
| Name | --vscode-settings-checkboxForeground |
|---|---|
| Default value | #cccccc |