How to dynamically install custom elements

Sketch of the author’s face next to the headline “How to dynamically install custom elements”, with panels showing a JS file tree, custom elements, and JavaScript code.

Heydon Pickering shows a naming convention, a tiny define() helper, and an install() script that scans :not(:defined), dedupes matches, and dynamically imports only what is used. For dependent components, it can fire a ready event, or use a MutationObserver for elements added later.

heydonworks.com/article/dynamically-loading-custom-elements