Edit in GitHubLog an issue

sp-checkbox

Since: UXP v4.1

Renders a checkbox with associated label.

Checkboxes

See:

Example

Copied to your clipboard
<sp-checkbox>Include all metadata</sp-checkbox>

States

There are several states that are supported.

Checked

Copied to your clipboard
<sp-checkbox checked>Checked</sp-checkbox>

Indeterminate

Copied to your clipboard
<sp-checkbox indeterminate>Indeterminate</sp-checkbox>

Disabled

Copied to your clipboard
<sp-checkbox disabled>Disabled</sp-checkbox>

Invalid

Copied to your clipboard
<sp-checkbox invalid>Invalid</sp-checkbox>

Responding to events

You can respond to changes in the checkbox using the change or input events.

Copied to your clipboard
1document.querySelector(".yourCheckbox").addEventListener("change", evt => {
2 console.log(`Is the checkbox checked: ${evt.target.checked}`);
3})
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2023 Adobe. All rights reserved.