Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stepanvanzuriak/picohtml
HTML template strings
https://github.com/stepanvanzuriak/picohtml
dom pico render template-string
Last synced: 3 months ago
JSON representation
HTML template strings
- Host: GitHub
- URL: https://github.com/stepanvanzuriak/picohtml
- Owner: stepanvanzuriak
- License: mit
- Archived: true
- Created: 2018-09-09T05:23:12.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-18T05:23:24.000Z (over 4 years ago)
- Last Synced: 2024-07-05T13:50:38.611Z (4 months ago)
- Topics: dom, pico, render, template-string
- Language: TypeScript
- Size: 1.36 MB
- Stars: 12
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Powerfully ~2kB (gzip) HTML template strings
# Installation
```bash
$ npm install picohtml
```# Usage
```js
import { html, render } from "picohtml";const el = html`
Hello planet
`;render(el, document.body);
```## Attaching event listeners
```js
import { html, render } from "picohtml";const click = () => alert("Hello planet!");
const el = html`Click`;render(el, document.body);
```## Insert template literal and picohtml literal
```js
import { html, render, raw } from "picohtml";const text = `
Text
`;
const htmlText = () => html`HTML Text
`;
const el = html`${text} ${raw(htmlText())}`;render(el, document.body);
```## License
[MIT](./LICENSE)
## See Also
- [nanohtml](https://github.com/choojs/nanohtml)
- [lit-html](https://github.com/Polymer/lit-html)