The sweetest way to build the web
Chocola compiles enhanced HTML, CSS, and JS straight to the browser. Write logic as HTML, not template strings — no bundler, no virtual DOM, only one dependency.
<p>Status: {status}</p>
<div if="{status === 'live'}">
<span>● Online</span>
</div>
<p>
Status: <span>live</span>
</p>
<div>
<span>● Online</span>
</div>
if's and logic as elements, not templates
Chocola reads control flow the way it reads everything else: as HTML. No template language to learn, no curly-brace soup to escape: just attributes, and a tag that disappears when it's done its job.
<div if="{user.role
===
'admin'}">Admin Panel</div>
<div elif="{user.role
===
'editor'}">Editor Dashboard</div>
<div else>View
Only</div>
<void if={isLoaded}>
<h1>Data Loaded</h1>
<p>Here is your content.</p>
</void>
A recipe, and the thing it made from it
A component is a combination of HTML, CSS, and JavaScript logic that gets compiled and rendered into your app automatically.
<script>
import CoolButton from './CoolButton.html';
let self;
let input;
export let title = "Hello";
function $runtime() {
input.focus();
}
</script>
<template>
<div>
<h1>{title}</h1>
<input bind:self="input" type="text" placeholder="Your name">
<CoolButton label="Not lame button"></CoolButton>
</div>
</template>
<style>
h1 { color: chocolate; }
</style>
The enhanced HTML this component renders — logic blocks and bindings included
Props declaration and component logic
CSS placed inside <style> is automatically scoped to the component — it won't leak out and affect other components.
Install once. Compile forever.
No boilerplate. No plugins to reconcile. Point Chocola at a folder.
npm i chocola