Skip to content
/ rbel Public
forked from aaaristo/rbel

🗃allows to define custom elements for hyperx, defaulting to your h function of choice

Notifications You must be signed in to change notification settings

Tram-One/rbel

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rbel

Fork of rbel

use custom elements in tagged template literals

example

const domBuilder = require('hyperx')
const h = require('nanohtml');
const html = require('rbel')(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

Values to use for h:

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

About

🗃allows to define custom elements for hyperx, defaulting to your h function of choice

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%