Home

Awesome

<em>µ</em>html

Downloads build status Coverage Status CSP strict

snow flake

<sup>Social Media Photo by Andrii Ganzevych on Unsplash</sup>

uhtml (micro µ html) is one of the smallest, fastest, memory consumption friendly, yet zero-tools based, library to safely help creating or manipulating DOM content.

📣 uhtml v4 is out

Documentation

Release Notes


Exports

uhtml/init example

import init from 'uhtml/init';
import { Document } from 'uhtml/dom';

const document = new Document;

const {
  Hole,
  render,
  html, svg,
  htmlFor, svgFor,
  attr
} = init(document);

uhtml/preactive example

import { render, html, signal, detach } from 'uhtml/preactive';

const count = signal(0);

render(document.body, () => html`
  <button onclick=${() => { count.value++ }}>
    Clicks: ${count.value}
  </button>
`);

// stop reacting to signals in the future
setTimeout(() => {
  detach(document.body);
}, 10000);