1.2.5 • Published 2 years ago

restre-web-comps v1.2.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

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);
1.2.5

2 years ago

1.0.0

2 years ago