dominity is a minimalist frontend framework to make data heavy single page applications(SPA) which feels snappy and fast. It is performant and lightweight and needs no build step making development of SPA's effortless
dominity has everything what you need from a powerful clientside router to a state Mangement solution. and as cherry on top many plugins to extend its functionality formvalidation , tables and more
- simple and intutive api
- you dont need a buildstep
- lightweight
- reactive with signals
- no virtual dom
- no uncecessary naming conventions
- builtin clientside routing
- builtin state management
import {button,state,derived} from "dominity"
function counter() {
const count = state(0);
const doubleCount = derived(() => count.value * 2);
return button("count is :",doubleCount).on("click",()=>{
count.value++
})
}
Counter().addTo(document.body);
use directly via cdn or install form npm
import d from "https://esm.sh/dominity
or
npm i dominity
recommened to use vite with dominity
instead of making html tags , dominity provides functions to create elements , functions are more flexible as they can be rerun multiple times and you can add any sort of logic to them nesting functions allows you to create complex uis
<main>
<h1>hello world</h1>
<button id="btn">click me</button>
</main>
<script>
document.querySelector("#btn").addEventListener("click",()=>{
alert("hello world")
})
</script>
import {h1,button,main} from "dominity"
let app=main(
h1("hello world"),
button("click me").on("click",()=>{
alert("hello world")
})
)
app.addTo(document.body)
this makes for easier ui layouts where the form and function are closely coupled together with semantics
- Fork the repository
- Clone the forked repository
- Install dependencies
- the sorce code is in
src
folder , you can see thez_old_dominity.js
file to gain an idea of how the code looks , the library is split into multiple files so work on the part u need one at a time - test out the changes at
playground
(live test environment ,use test.js) cd there and and run dev - submit a pull request
- will be checked and merged