@gauravnumber/h.js
v1.0.3
Published
Minimal hyperscript-style DOM helper
Downloads
5
Maintainers
Readme
@gauravnumber/h.js
A tiny, zero-dependency DOM helper that mimics JSX/hyperscript-style syntax using plain JavaScript. Great for building UI components without any frameworks.
✨ Features
- Lightweight and framework-free
- Works seamlessly with functions as components
- Supports event listeners, styles, and children
📦 Installation
npm install @gauravnumber/h.js🚀 Usage
import { h } from "@gauravnumber/h.js";
const Hello = ({ name }) => {
return h("span", {}, `Hello, ${name}!`);
};
const App = () =>
h(
"div",
{},
h("h1", {}, "h.js"),
h(Hello, { name: "Gaurav" }),
h("p", {}, "Built from scratch using vanilla JS!")
);
document.body.appendChild(App());