Edit in GitHubLog an issue

sp-checkbox

Since: UXP 4.1, PS 22.0.0

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})
Copyright © 2021 Adobe. All rights reserved.