- 🌞 JSX, nothing else
- 💎 Supports attributes & events
- ❌ No reactivity, vdom or components
- ⚡ Small bundle size (463 B)
npx create-solojsx-app project-name
npx create-solojsx-app # in current folder
npx create-solojsx-app -m # minimal template
npx create-solojsx-app -js # javascript
bunx create-solojsx-app-bun project-name # using bun
const e = <div> Hello from SoloJSX </div>
document.body.appendChild(e)
const f = (text) => alert(text)
const e = <div style="color: red" onclick={() => f("Hi")}> Click Me </div>
const e = <div> {[1, 2, 3].map(i => <div> {i} </div>)} </div>
const e = <div> {true ? <div> Hello </div> : null} </div>
const inner = <div> Hello </div>
const e = <div> {inner} </div>
const style = { color: "red" }
const e = <div style={style}> Hello </div>
const input = <input />
const list = <ul></ul>
const add = () => list.prepend(<li> {input.value} </li>)
const btn = <button onClick={add}> Add </button>
document.body.append(input, btn, list)
- https://github.com/SoloJSX/SoloJSX-template-ts
- https://github.com/SoloJSX/SoloJSX-template-ts-minimal
- https://github.com/SoloJSX/SoloJSX-template-js
- https://github.com/SoloJSX/SoloJSX-template-ts-todo
MIT