@b9g/crank/standalone

Template tag functions for writing JSX-like syntax without a build step.

Installation

npm install @b9g/crank
import {jsx, html} from "@b9g/crank/standalone";

Functions

Quick start

import {jsx} from "@b9g/crank/standalone";
import {renderer} from "@b9g/crank/dom";

function Greeting({name}) {
return jsx`<p>Hello, ${name}!</p>`;
}

renderer.render(
jsx`<${Greeting} name="World" />`,
document.getElementById("root")
);

Why use standalone?

The standalone module lets you write Crank components without:

It's great for:

For production applications with many components, using a proper JSX transform is recommended for better developer experience and tooling support.

Edit on GitHub