Skip to content
Mubarrat edited this page Jul 18, 2025 · 19 revisions

Dom-Builder

Looking for HTML Builder? The project was renamed to Dom-Builder starting from version 3.0.0 for clarity. If you want to continue using the older html-builder, use versions less than 3.0.0.


Overview

Dom-Builder is a modern JavaScript library designed for declarative construction and updating of DOM elements with simplicity and precision.

It is an evolution of html-builder, improving the API for better clarity, adopting an MVVM-friendly architecture, and providing a cleaner developer experience.


What’s New in Dom-Builder (v3+)

  • The library is renamed to Dom-Builder to emphasize its focus on DOM manipulation.
  • Removed the old build() pattern — now declarative usage is default and simpler.
  • Added optional MVVM utilities such as observable, computed, and reupdate to enhance state management.
  • Removed verbose new HtmlItem(...) syntax, replaced with a concise, fluent $html.div(...) style API.
  • Smaller, faster, and completely framework-agnostic.

Getting Started

Dom-Builder is primarily browser-focused and intended to be used via direct <script> tags.

Installation

  • Download the latest release from the Releases page.
  • Or include via CDN:
<script src="https://cdn.jsdelivr.net/gh/Mubarrat/dom-builder@3.x/dist/dom.min.js"></script>

Migration from HTML Builder

  • dom-builder is a continuation of html-builder starting from version 3.0.0.
  • No major breaking changes, but some API simplifications.
  • The old build() method is no longer needed.
  • The long-form new HtmlItem(...) syntax has been removed — use the new concise $html syntax.
  • MVVM-style utilities are newly introduced to improve state handling.

For more, see the Migration Guide.


Documentation and Resources


License

Dom-Builder is released under the MIT License.

Clone this wiki locally