Hastscript-like utility to create HTML strings
$ npm install luciascript
# Or with yarn
$ yarn add luciascript
Luciascript exports UMD, CJS, and ES builds.
// ES
import { l } from "luciascript";
// CJS
const { l } = require("luciascript");
// UMD
const { l } = window.Luciascript;
Luciascript has the following type declarations:
declare l(tag: string, props: Record<string, string> = {}, children: string[] | string[] = []) => string;
Given those properties it will generate HTML.
l("div", { className: "foo", id: "bar", style: "text-align: center;" }, [
l("p", {}, "Hello World!"),
l("button", {}, "Click Me!")
])
<div class="foo" id="bar" style="text-align: center;">
<p>Hello World</p>
<button>Click Me!</button>
</div>