SonnetJS
You don't always need node_modules
A zero-dependency, zero-build component boilerplate.
Not a framework, just plain JavaScript with some opinions.
Open index.html and go.
A component is a class and a template
Define the markup, wire behavior in script with
ordinary DOM APIs. The button below is this exact code, running live.
class Counter extends Component {
static template = `<button>count is 0</button>`
script(root) {
let count = 0
const button = root.querySelector('button')
button.addEventListener('click', () => {
button.textContent = `count is ${++count}`
})
}
}
Why Sonnet
-
Zero build
Classic scripts only. Works straight from the filesystem over
file://. -
Zero dependencies
The whole framework is one small file:
core.js. - No magic No virtual DOM, no reactivity, no proxies. What you write is what runs.
- Just opinions One class per component, a template, plain DOM APIs, JSDoc types. Conventions, not machinery.
Get started in seconds
# grab the boilerplate
git clone https://github.com/sonnetjs/sonnet
# there is no step two, just open index.html in a browser
Read the docs to learn the full API. It fits on one page.