2.4.16 • Published 9 months ago

solojsx v2.4.16

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

SoloJSX

npm npm npm package minimized gzipped size GitHub

  • :sun_with_face: JSX, nothing else
  • :gem: Supports attributes & events
  • :x: No reactivity, vdom or components
  • :zap: Small bundle size (463 B)

Getting started

npx create-solojsx-app project

Options

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 # using bun

Usage

const e = <div> Hello from SoloJSX </div>
document.body.append(e)

Attributes

<div style="color: red"> Hello </div>

Events

const f = (text) => alert(text)
<div onclick={() => f("Hi")}> Click Me </div>

Arrays

<div> {[1, 2, 3].map(i => <div> {i} </div>)} </div>

Ternaries

<div> {true ? <div> Hello </div> : null} </div>

Nested elements

const inner = <div> Hello </div>
<div> {inner} </div>

Style object

const style = { color: "red" }
<div style={style}> Hello </div>

Examples

Simple todo list

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)

Advanced todo list

Templates

License

MIT

2.2.1

11 months ago

2.2.0

11 months ago

2.4.1

10 months ago

2.2.3

11 months ago

2.4.0

10 months ago

2.2.2

11 months ago

2.4.3

10 months ago

2.2.5

11 months ago

2.4.2

10 months ago

2.2.4

11 months ago

2.4.5

10 months ago

2.2.7

10 months ago

2.4.4

10 months ago

2.2.6

10 months ago

2.3.0

10 months ago

2.4.14

10 months ago

2.4.13

10 months ago

2.4.16

9 months ago

2.4.15

10 months ago

2.4.10

10 months ago

2.4.12

10 months ago

2.4.11

10 months ago

2.1.0

11 months ago

2.4.7

10 months ago

2.4.6

10 months ago

2.2.8

10 months ago

2.4.9

10 months ago

2.4.8

10 months ago

1.2.8

1 year ago

2.0.3

11 months ago

2.0.2

11 months ago

2.0.4

11 months ago

2.0.1

11 months ago

2.0.0

11 months ago

1.2.9

1 year ago

1.2.10

11 months ago

1.2.0

1 year ago

1.1.9

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.1.8

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.1.7

1 year ago

1.0.8

1 year ago

1.1.6

1 year ago

1.0.7

1 year ago

1.1.5

1 year ago

1.0.6

1 year ago

1.1.4

1 year ago

1.0.5

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.4

1 year ago

1.0.2

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago