+
Skip to content

9elt/miniframe

Repository files navigation

Miniframe

Miniframe is a better version of document.createElement with support for JSX and minimal state management in 500 lines of code. It was created for people that like vanilla JS and enjoy rolling out their own code, but don't like how convoluted and inconvenient it is to create and manage html elements.

It provides a createNode function

const div = createNode(
    <div>
        <p>Hello, World!</p>
    </div>
);

And a State class to easily control the nodes

const name = new State("World");

const div = createNode(
    <div>
        <p>Hello, {name}!</p>
    </div>
);

div.outerHTML; // "<div><p>Hello, World!</p></div>"

name.value = "Miniframe";

div.outerHTML; // "<div><p>Hello, Miniframe!</p></div>"

Quick start

Quickly start a project with

npx @9elt/miniframe

Documentation

Detailed documentation and examples are available here

About

A better version of document.createElement with support for JSX and minimal state management in 500 LOC

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载