Note
Looking for HTML Builder?
You're in the right place — the project has been renamed to Dom-Builder starting from version 3.0.0 for clarity.
If you're using the older html-builder
, simply stick to version <3.0.0
.
Dom-Builder is a modern JavaScript library for declaratively constructing and updating DOM elements with simplicity and precision. It improves upon the previous html-builder
by offering a cleaner, MVVM-friendly architecture and clearer naming.
You can check out the Wiki for this.
Download the latest release files from this GitHub repository.
After extracting the zip, you'll find:
dom-builder
├── dom.d.ts
├── dom.d.ts.map
├── dom.js
├── dom.js.map
├── dom.min.js
└── dom.min.js.map
<script src="https://cdn.jsdelivr.net/gh/Mubarrat/[email protected]/dist/dom.js"></script>
Minified:
<script src="https://cdn.jsdelivr.net/gh/Mubarrat/[email protected]/dist/dom.min.js"></script>
Not available via GitHub Packages or npm This library is browser-focused and intended to be used directly via
<script>
tags, not through package managers.
Use the CDN or Releases to include it in your project.
There are no major breaking changes between html-builder
and dom-builder
.
dom-builder
is a renamed continuation ofhtml-builder
, starting from version3.0.0
.- The majority of the API remains declarative and unchanged.
- The
build()
method is no longer needed indom-builder
. - The long-form
new HtmlItem(...)
syntax is removed — use concise$html.div(...)
-style instead. - The new version introduces optional MVVM-style utilities like
observable
,computed
,bind
,bindSelect
, andbindMap
.
See Migration from html-builder for more details.
Tip
Consider adopting MVVM-style view models for better state management.
Check out the Wiki for:
- API Documentation
- Examples
- Best Practices
- Migration from html-builder
- MVVM Patterns (optional)
Dom-Builder is licensed under the MIT License.