npm.io
1.0.5 • Published 4 years ago

baugruppe

Licence
MIT
Version
1.0.5
Deps
0
Size
2 kB
Vulns
0
Weekly
0

Baugruppe is a tool for building html elements in javascript

Example

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())