restre-web-comps
v1.2.5
Published
An alternative to web comps
Downloads
2
Readme
Web Comps
Restress alternative to web components
Usage:
var comp = window.comp({
html: "<a>nope!</a>",
classes: ["btn", "btn-primary"] // <- css classes
});
comp.render(document.body);
Attach Shadow Roots:
var comp = window.comp({
html: "<button>Test</button>"
})
comp.shadow().appendChild(/* children node */);
Or Create Component-only states:
var comp = window.comp({
template: "<button>{{count}}</button>"
})
comp.initState("count", 0);
comp.states.count++;
Set Props and IDs:
comp.id("root").render(document.body);