baugruppe

1.0.5 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i baugruppe

Weekly Downloads

1

Version

1.0.5

License

MIT

Unpacked Size

1.9 kB

Total Files

3

Last publish

Collaborators

  • eli_xi