Is spectrum web components is required?

Is it required to use Adobe web components inside uxp? or we can use normal HTML tags and style them to look like spectrum web components?

the reason behind this question is that I encountered a lot of bugs using spectrum web components inside uxp (ex: change event is not working on input elements and many more).

1 Like

Hi @argie_olendan, I’ll chime in here since it looks like no one jumped in. Working with the Adobe-provided web components isn’t required, they just make the process of staying on brand easier. However it’s worth noting, what you may perceive as “bugs” might more accurately be described as awkward developer experience and gotchas that come from misunderstanding how the UXP stack works. I say this not as a jab at you, but as validation that you’ve taken the first steps down a path all of us have had to trip and fall down before getting started.

Importantly, there are (at least) three things named “spectrum” that appear like they’re what you’re supposed to use for building plugins, but only one of them is intended for UXP. Using the others (which arguably are nicer to work with) will cause all kinds of headaches. The one you want is Spectrum UXP.

Regarding the onChange issues, I suspect you’re experiencing the gotcha of trying to use web components with React, in which event propagation doesn’t work the way you’d expect. For that, I recommend looking at React UXP Spectrum which provides React wrappers around the components that handle these gotchas. I’ve been using it in GuideGuide since UXP launched and it’s worked without issues.