Baugruppe is a tool for building html elements in javascript
import baugruppe from 'baugruppe'
// this will create a div with '.example' class
function buildExampleComponent() {
return baugruppe.build('div', '.example')
}
// this will create a div with children
function buildAnotherExampleComponent() {
const childOne = baugruppe.build('p', '.title')
const childTwo = baugruppe.build('p', '.content')
return baugruppe.build('div', '.anotherExample', [childOne, childTwo])
// if only need one child to append
// return baugruppe.build('div', '.anotherExample', childOne)
}
document.body.appendChild(buildExampleComponent())