1.0.2 • Published 5 years ago

@cfhull/dom-it v1.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

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',
      })
    )
  )
}