2.1.0 • Published 3 years ago

tiny-html-builder v2.1.0

Weekly downloads
3
License
ISC
Repository
github
Last release
3 years ago

README: tiny-html-builder

Tiny helper for creating html fragments with event binding, written in typescript.

It's...

  • Fast
  • Simple
  • Extremely small

Usage

import { div, p, b, event } from "tiny-html-builder";

const click = (callback, children) => event('click', callback, children);

const fragment = div("display:flex", [
    div("my-class-name"),
    p({}, 
        click(event => console.log,
            b("This is an example")
        )
    )
]);

// Returns: A html fragment

A more complete example can be found in example.ts

Why

Why not? Sometimes you just need a simple tool to do a simple job.

Limitations

  • This is not in any way a replacement for react/angular/vue etc. It does not support a way of automatically updating the dom when data is changed.
  • There's no dom-diff built in. This might be added in the future.
2.1.0

3 years ago

2.0.0

3 years ago

1.4.0

3 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago