@cfhull/dom-it

1.0.2 • Public • Published

dom-it

dom-it is a helper library to create dom elements in a declarative and functional manner.

Usage

npm i -S @cfhull/dom-it

import elements from '@cfhull/dom-it'

// Can take any valid html element
const { div, span, label, input, ...} from elements

const render = () {
  div({ id: 'app' },
    div({ className: 'header' },
      span({
        className: 'title',
        innerHTML: 'This is a page title',
      })
    )
    div({ className: 'content'},
      input({
        className: 'form-control',
        placeholder: 'placeholder text',
      })
    )
  )
}

Readme

Keywords

none

Package Sidebar

Install

npm i @cfhull/dom-it

Weekly Downloads

2

Version

1.0.2

License

ISC

Unpacked Size

3.21 kB

Total Files

4

Last publish

Collaborators

  • cfhull