Can I use existing ha-* web components for my UI? I would like to, they’re super convenient, but the documentation isn’t very clear about it. Here Lovelace: Custom Cards | Home Assistant Developer Docs example shows how to use ha-card, but, when I’m trying to use for ex. hass-tabs-subpage-data-table, it doesn’t work, because of the lazy loading. But after I visit any built-in panel which is using that component, my panel is also being loaded. I understand all webpack, modules, import stuff, and that I can’t import ha-* components directly into my custom JS.
Why am I facing this?
I originally started making my UI using the tutorial above, importing lit and custom UI web components, and I’ve realized that I can’t import @paper, @mwc web components, as they’re already registered inside the page. So, I either would like to find a way to re-use HA stuff as much as possible (preferred) or will be forced to use some completely different UI library to avoid customElements conflicts.
Is it possible (recommended) to re-use HA web components for the custom UI?
I’m having the same exact problem, it would be very very convinient to be able to use all ha
web components inside custom panels.
It’s also very strange because some components are loaded like
Did you find an answer to your question? I am currently trying to develop a custom React Dashboard and it would be so convenient to use the HA custom elements inside.
This makes more elements available. Such as ha-checkbox, ha-chip and hass-tabs-subpage-data-table.
Before this fix I had 239 available elements and after this fix 330.
It does not work for everything. The element ha-chip-set is a container for the ha-chip, but it is still not available after this code is ran.