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
Attribute autofocus Type boolean
Default false
- checked reflected
Attribute checked Type boolean
- defaultChecked reflected
Attribute default-checked Type boolean
Default false
- disabled reflected
Attribute disabled Type boolean
Default false
- focused reflected
Attribute focused Type boolean
Default false
- form readonly
Type HTMLFormElement | null
- indeterminate reflected
Attribute indeterminate Type boolean
Default false
- invalid reflected
Attribute invalid Type boolean
Default false
- label
Label text. It is only applied if component's innerHTML doesn't contain any text.
Attribute label Type string
- name reflected
Attribute name Type string | undefined
Default undefined
- required reflected
Attribute required - validationMessage readonly
Type string
- validity readonly
Type ValidityState
- 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.
Attribute value Type string
Default ''
- version readonly
VSC Element version
- willValidate readonly
Type boolean
Methods
- checkValidity
Return boolean
- reportValidity
Return boolean
Events
- change
Dispatched when checked state is changed. The event is bubbled, so it can be listened on a parent element like the
CheckboxGroup
.Type Event
- invalid
Dispatched when the element is invalid and
checkValidity()
has been called or the form containing this element is submitted. MDN ReferenceType Event
- vsc-change deprecated
Type CustomEvent
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