elkit
About
A handy toolkit for creating, diffing, and updating html elements with support for building stateful components, this package is a collection of modules including bel, nanomorph & a component module.
This collection of modules is what I use for building components for UI projects, but you may prefer to use bel & nanomorph separately, use similar alternatives, or use a different component module like nanocomponent.
Install
npm install --save elkit
Usage
Create an html element:
var html = var el = html`hi`
Update an html element:
var html = var update = var el = html`hi` console// => '<p>hola</p>'
Server-side usage:
var html = var el = html`hi`var str = el // send this string value in http responses, for example
Create stateful components:
var html = var createComponent = var component = var el = component console// => <p>message: hi</p>
Examples
See also
- elkit is compatible with and shares modules with choo
- it's inspired by yo-yo
- the
component
module is based in part on nanocomponent
Contributing
Contributions are welcome! Please read the contributing guidelines first.
Conduct
It's important that this project contributes to a friendly, safe, and welcoming environment for all, particularly for folks that are historically underrepresented in technology. Read this project's code of conduct
Change log
Read about the changes to this project in CHANGELOG.md. The format is based on Keep a Changelog and this project adheres to Semantic Versioning.