Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
Instantiate Svelte Component in HTML5 Custom Tag (without Shadow DOM)

I'm building a Svelte component library to be consumed using JavaScript only. At a later stage also by other Svelte applications as an additional option.

I want to avoid Svelte's custom element feature, since there are limitations with true Web Components and its Shadow DOM.

Currently the component is instantiated like this:

<div id="my-component"></div>
<script>
    document.addEventListener("DOMContentLoaded", function (event) {
        new MySvelteComponent({
            target: document.getElementById("my-component"),
            props: {
                firstProp: true,
                secondProp: "some value"
            }
        });
    });
</script>

Now I would like to provide a more elegant way by defining a HTLM5 custom tag like:

<my-component firstProp="true" secondProp="some value">

What is a good way to implement this?

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!