I’m a bit confused about where we’re supposed to get our official Spectrum icons from. I found the Spectrum design icons here: Spectrum Icons, but it says clearly, “These icons are only to be used for design. When engineering your product, you can find the icon implementations in A4U,” yet the provided link to “A4U” is broken.
I build nearly all of my dialogs and panels using a programmatic approach. I had struggled getting the icons working correctly. They kept showing the alert icon rather than the ones I wanted. I finally figured out the way to make them display correctly was by using .setAttribute() to set the name, size, and slot. As an example of that:
It is not necessary to set the element to be a part of the dialog; I tend to do so to provide direct access if needed in the future. Thus, rather than dialog_o.icon_o = you could use let icon =, for example.
The dialog-s-icon class is in my .css file and is used to force some space above. You could just set the .style for that here.