ninlil

2.0.0 • Public • Published

ninlil

Fork of rbel

use custom elements in tagged template literals

example

const domBuilder = require('hyperx')
const h = require('belit');
const html = require('ninlil')(domBuilder, h, {
    row: (attrs, children) => html`
        <div class="row">
           ${children}
        </div>`,
    column: (attrs, children) => html`
        <div class="col col-md-${attrs.md}">
           ${children}
        </div>`,
});

console.log(html`
<row>
    <column md="12">
        <span>1 ciao!</span>
    </column>
</row>`.outerHTML);

Values to use for domBuilder:

  • hyperx - hyperx
  • hyperz - hyperz

Values to use for h:

  • virtual-dom - vdom.h
  • react - React.createElement
  • bel - require('bel').createElement (only client side see #1)
  • belit - belit (both SSR and client)
  • hyperscript - hyperscript

Readme

Keywords

none

Package Sidebar

Install

npm i ninlil

Weekly Downloads

0

Version

2.0.0

License

BSD

Unpacked Size

1.41 kB

Total Files

3

Last publish

Collaborators

  • jrjurman