You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.
The vscode-checkbox is a web component implementation of a checkbox element.
Usage
❌ Don't
✅ Do
Avoid grouping unrelated checkboxes together.
Split related checkboxes into groups of with descriptive labels. It's ok to group up to three loosely-unrelated checkboxes into one group if using a label that generally captures their purpose.
❌ Don't
✅ Do
Avoid using horizontal checkbox group layouts.
Arrange checkbox groups vertically to make it easy to scan and compare options.
❌ Don't
✅ Do
Don't use an ambiguous label that makes it difficult to understand what the checkbox does.
Use checkbox labels that imply clearly opposite states.
Checkboxes can also render an indeterminate state. This is achieved by getting a reference to a given checkbox using JavaScript and then setting the indeterminate property of the checkbox to true.
Here is an example of the Visual Studio Code Checkbox and its various attributes being used in a form.
<form><fieldset><legend>Fieldset Legend</legend><vscode-checkboxcheckedrequired>Checked + Required</vscode-checkbox><vscode-checkboxcheckedreadonly>Checked + Readonly</vscode-checkbox><vscode-checkboxautofocus>Autofocus</vscode-checkbox><vscode-checkboxdisabled>Disabled</vscode-checkbox><vscode-checkboxvalue="baz">Value Set To "baz"</vscode-checkbox></fieldset><vscode-buttontype="submit">Submit Button</vscode-button></form>