-
Notifications
You must be signed in to change notification settings - Fork 0
Overview
Sad Gabi edited this page Jul 26, 2026
·
11 revisions
The
2.0.0-next.4pre-release is now available on npm, introducing Single-File Components as.htmlfiles.If interested in trying it out, install with
npm i chocola@nextto get the latest Chocola 2 pre-release and read the documentation included in the code for up-to-date info.
Chocola is a web framework designed for simplicity and modularity. It lets you build components by compiling JS modules into HTML templates, CSS, and JS logic, keeping your projects clean and optimized.
// Counter.js
import body from "./html/counter.html";
import styles from "./css/counter.css";
function RUNTIME(self, ctx) {
self.querySelector("button").addEventListener("click", () => {
ctx.count++;
})
}
export default function Counter() {
return {
body,
styles,
script: RUNTIME
}
}Chocola handles the compilation for you, outputting a fully functional web app with vanilla JavaScript — no extra libraries needed.