Haml structure. CoffeeScript semantics. React runtime.
Zero overhead. 50% fewer tokens than JSX.
.card
%h2= post.title
- if showBody
.body= post.content
import { jsx, jsxs } from "react/jsx-runtime";
jsxs("div", { className: "card" },
jsx("h2", null, post.title),
...(showBody ? [
jsx("div", { className: "body" }, post.content)
] : [])
);
npm install coffeehaml
// vite.config.ts
import coffeehaml from 'coffeehaml/vite';
export default {
plugins: [coffeehaml()],
};
npx coffeehaml compile app.coffeehaml
Supports .chaml, .coffeehaml, and .cohaml extensions.
Full documentation on GitHub.