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

181
Views
Better approach to render Svelte components from CMS driven HTML markup

I have the following scenario.

The CMS returns the markup to the browser in this format, where we need to render Svelte components in their respective placeholders.

  • class="component" is the placeholder the component to render
  • name="Header" is the name of the component
  • props="{}" props passed to the component
<div class="component" name="Header" props="{...}"></div>

<div>Some other content, not a component</div>

<div class="component" name="Accordion">
  <div class="component" name="AccordionItem" props="{...}">
    <p>Accordion item 1 body</p>
  </div>
  <div class="component" name="AccordionItem" props="{...}">
    <p>Accordion item 2 body</p>
  </div>
  <div class="component" name="AccordionItem" props="{...}">
    <p>Accordion item 3 body</p>
  </div>
  <div class="component" name="AccordionItem" props="{...}">
    <p>Accordion item 4 body</p>
  </div>
</div>

<div class="component" name="Footer" props="{..}"></div>

Parent components like Accordion must be able to control its child components.

Here is my progress so far: https://codesandbox.io/s/crazy-wu-oey2k?file=/public/index.html:430-1321

Looking for help and suggestions for a better way to implement it.

Thank you!

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!