Checkbox

<vscode-checkbox>

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

Properties

autofocus reflected
Attributeautofocus
Typeboolean
Defaultfalse
checked reflected
Attributechecked
Typeboolean
defaultChecked reflected
Attributedefault-checked
Typeboolean
Defaultfalse
disabled reflected
Attributedisabled
Typeboolean
Defaultfalse
focused reflected
Attributefocused
Typeboolean
Defaultfalse
form readonly
TypeHTMLFormElement | null
indeterminate reflected
Attributeindeterminate
Typeboolean
Defaultfalse
invalid reflected
Attributeinvalid
Typeboolean
Defaultfalse
label

Label text. It is only applied if component's innerHTML doesn't contain any text.

Attributelabel
Typestring
name reflected
Attributename
Typestring | undefined
Defaultundefined
required reflected
Attributerequired
validationMessage readonly
Typestring
validity readonly
TypeValidityState
value

Associate a value to the checkbox. According to the native checkbox specification, If the component participates in a form:

  • If it is unchecked, the value will not be submitted.
  • If it is checked but the value is not set, on will be submitted.
  • If it is checked and value is set, the value will be submitted.
Attributevalue
Typestring
Default''
version readonly

VSC Element version

willValidate readonly
Typeboolean

Methods

checkValidity
Returnboolean
reportValidity
Returnboolean

Events

change

Dispatched when checked state is changed. The event is bubbled, so it can be listened on a parent element like the CheckboxGroup.

TypeEvent
invalid

Dispatched when the element is invalid and checkValidity() has been called or the form containing this element is submitted. MDN Reference

TypeEvent
vsc-change deprecated
TypeCustomEvent

Custom CSS Properties

--vsc-foreground-translucent

Label font color. 90% transparency version of --vscode-foreground by default.

--vscode-focusBorder

--vscode-font-family

--vscode-font-size

--vscode-font-weight

--vscode-settings-checkboxBackground

--vscode-settings-checkboxBorder

--vscode-settings-checkboxForeground