Uijx is a unobtrusive toolkit for building reactive web apps from your favorite server-side templating engine.
Sveltejs, vuejs, react, angular ... are great tools for creating a reactive web application, but these tools require additional skills and basics that are not available neccessarily.
The idea of the UIjx project is to design reactive web applications directly from its favorite server-side templating language (Twig, Blade, Razor, JSF, ...), so a backend developer can build an single page application without going through a component-based UI framework.
In addition, UIjx is unobtrusive : you use data-*
type HTML attributes to describe interaction you want in a very intuitive way.
Basic UIjx concepts:
Download the latest stable release of UIjx, move it to your assets folder and add the library to your base layout template like this:
<script src="assets/js/uijx/dist/uijx.min.js"></script>
And that's all
Working with UIjx will consist most of the time of adding annotations to your HTML tags. These annotations come in the form of attributes of type data-*
.
In the example below, when clicking on the link UIjx will issue a request to the URL and replace the contents of the tag #target
by the result, or log the error in console if occured:
...
<div id="app-root">
<a href="http://www.foo.bar" data-on:link ="-> $dom.target.html" data-link-error="console.error($data)">Load content</a>
<div id="target"></div>
</div>
...
<script src="uijx.min.js"></script>
<script>
Uijx
.connect('app-root')
.start();
</script>