Edit in GitHubLog an issue

Spectrum Web Component

Since UXP v7.0

To understand Spectrum Web Components (popularly known as SWC), you must first familiarize yourself with

  • Web components: HTML5 Web technology that lets you define custom HTML tags.
  • Spectrum: An open-source design language and guidelines provided by Adobe.

Spectrum Web Components are open-source Adobe Spectrum-styled Web Components. UXP v7.0 introduces the support for Web Components and Spectrum Web Components (SWC).

Getting started

Step 1: Enable SWC in manifest.json

  • Use manifestVersion version 5 or above
  • Enable the enableSWCSupport feature flag
Copied to your clipboard
"manifestVersion": 5,
"host": [
{
"app": "PS",
"minVersion": "24.4"
}
],
"featureFlags": {
"enableSWCSupport": true
}

Step 2: Install the component. For example,

Copied to your clipboard
npm install @swc-uxp-wrappers/button

Step 3: Import the component

Copied to your clipboard
import '@swc-uxp-wrappers/button/sp-button.js';
Copied to your clipboard
<sp-button variant="primary">I'm a button</sp-button>

Sample plugin

The following resources are available for you to get started quickly

Command line Templates

Use command-line tools (starter templates) for setting up a new UXP-based React/Vanilla app with SWC bundling. It helps you quickly scaffold a project optimized for building UXP plugins using SWC.

Photoshop

InDesign

Make sure you follow the README of the above plugins.

List of supported SWC

Refer to the Github page for the list of the components and their variants. Note With UXP v8.0.0, all the SWC components in UXP are locked to version 0.37.0. Note Apart from the components specific known issues, RTL direction parameter does not work with sp-theme across components.

Was this helpful?
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.