Skip to content
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
95db6ce
Updated CHANGELOG and package.json
hexplus Mar 28, 2026
56080d8
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 28, 2026
7eeec49
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 28, 2026
14a9cd4
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
9487727
ci: use npm install instead of npm ci
hexplus Mar 29, 2026
6b4bd83
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
0b9a0cc
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
0777184
trusted-publisher
hexplus Mar 29, 2026
4d46e82
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
bea9788
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
825a8dc
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
55c4436
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
0d2c7e0
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
8da81e8
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
325ce5d
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Mar 29, 2026
0cad329
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 1, 2026
aea6787
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 4, 2026
00e5e88
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 7, 2026
b10a2c5
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 7, 2026
639eae0
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 9, 2026
405e4fe
Merge branch 'main' of https://github.com/hexplus/SibuJS
hexplus Apr 11, 2026
ee7cf48
Updated main
hexplus Apr 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 29 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,10 @@ import { div, h1, button, signal, mount } from "sibujs";
function Counter() {
const [count, setCount] = signal(0);

return div({
nodes: [
h1({ nodes: () => `Count: ${count()}` }),
button({
nodes: "Increment",
on: { click: () => setCount(c => c + 1) }
})
]
});
return div({ class: "counter" }, [
h1(() => `Count: ${count()}`),
button({ on: { click: () => setCount(c => c + 1) } }, "Increment"),
]);
}

mount(Counter, document.getElementById("app"));
Expand All @@ -43,32 +38,41 @@ mount(Counter, document.getElementById("app"));

SibuJS gives you maximum flexibility with three interoperable styles:

#### 1. Tag Factory (Full Props)
Maximum control with an explicit properties object. Perfect for complex elements.
#### 1. Tag Factory
The canonical form: a props object followed by children as a second
positional argument. No `nodes:` key required at any level of the tree —
children can be a string, a number, a single node, an array, or a
reactive getter.

```javascript
import { div, h1, button } from "sibujs";

const [count, setCount] = signal(0);

return div({
class: "counter",
nodes: [
h1({ nodes: () => `Count: ${count()}` }),
button({ nodes: "Increment", on: { click: () => setCount(c => c + 1) } })
]
});
import { div, h1, label, input, button } from "sibujs";

return div({ class: "counter" }, [
h1({ class: "title" }, () => `Count: ${count()}`),
label({ for: "amount" }, "Step"),
input({ id: "amount", type: "number", value: 1 }),
button(
{ class: "primary", on: { click: () => setCount(c => c + 1) } },
"Increment",
),
]);
```

#### 2. Shorthand API
Concise and readable for common layouts. Class and children passed as positional arguments.
All legacy forms — `tag({ class, nodes })`, `tag("className", children)`,
`tag("text")`, `tag([children])`, `tag(node)`, `tag(() => reactive)` —
continue to work unchanged. When both `props.nodes` and the positional
second argument are present, the positional wins.

#### 2. Positional Shorthand
The tersest form. Class and children as positional arguments, for
layouts with no event handlers or custom props.

```javascript
import { div, h1, button } from "sibujs";

return div("counter", [
h1(() => `Count: ${count()}`),
button({ nodes: "Increment", on: { click: () => setCount(c => c + 1) } })
button({ on: { click: () => setCount(c => c + 1) } }, "Increment"),
]);
```

Expand Down
Loading