On the github side I don’t see anything about NPM install
On the npm site when I search, I see 88 packages on specific component types but I don’t see anything that would install the entire library but maybe I missed it?
The part I’m confused on is how to get it to work in UXP. If I create a sp-switch component it shows up correctly. But if I try some other components they don’t. From what I’ve read Spectrum is built in, meaning I don’t have to import anything. But the example above didn’t work for me and I can’t find how to use it. I did download the node module bundle to my project.
The links to the Spectrum mention adding theme settings to the body tag but UXP sets the body tag up automatically and IIUC the plugin author simply adds their UI components to it.
In another post, it was mentioned that UXP doesn’t support all of the Spectrum components so I think that that might be the issue but that was a while ago.
I think XD might have exact same issue as Ps - Spectrum Web Components (WC) might actually be not supported. I believe you saw my post about theme awareness, but that’s not the main issue.
Both Ps and XD have the same docs, that you can use Spectrum WC
Also both Ps and XD have separate docs on Spectrum UXP (not to mix up with Spectrum WC)
I tried to make WC work on Ps, but failed miserably. Also, not only failed to make WC work, it seems that what actually is supported in Ps, is not Spectrum UXP either. Some supported components is a mix of UXP and WC. Very good example is sp-picker:
Docs say that sp-dropdown is supported in Spectrum UXP
Docs don’t even have sp-picker as supported component in Spectrum UXP
sp-picker is a pure Spectrum WC
Ps however supports sp-picker with a mixed inner HTML syntax of sp-dropdown
Ps does not work with sp-dropdown as one would expect
So basically Spectrum is a mess (at least in Photoshop) and I couldn’t make WC properly work there at all. Almost all sp-... elements for me were trial and error to achieve what I want.
Figured I’d share this experience, even if it’s for Ps
To add to what @Erin_Finnegan mentioned, I’d like to clarify a few things. Spectrum Web Components and Spectrum support in UXP are fundamentally different, in that, native Spectrum Widgets are in-built in UXP and don’t require any external imports. UXP only supports the ones listed here under Typography and User Interface. These native Spectrum Widgets are implementations of Spectrum guidelines and expose a subset of the functionality of the corresponding Spectrum Web Components but are not built atop web components. UXP has added initial support for Web Components commencing with v6.5 and should be rolling out support for the usage of a limited set of Spectrum Web Components (the ones listed here) with v7.0.
Thanks @indranil ! I’m looking forward to having more of it available. I do wish that the web pages for both could include a blurb about the differences between them as per @Karmalakas experience.