0.1.0 • Published 10 years ago
zirconium v0.1.0
zirconium
A picoframework for Web Components
usage
Your javascript:
var Zr = require('zirconium');
var h = require('hyperscript');
var myWidget = Zr({
  name: 'my-widget',
  elementDidInit: function(children) {
    return h('div', [
      h('div', {style: {color: 'red'}, 'hello world'),
      h('div', children)
    ]);
  }
});Your markup:
<!DOCTYPE html>
<html lang="en">
  <head>
    <title>Hello World</title>
    <script src="main.js"></script>
  </head>
  <body>
    <my-widget>
      <div>foo</div>
    </my-widget>
  </body>
</html>0.1.0
10 years ago