appblocks
v2.0.2
Published
A lightweight javascript library for building micro apps for the front-end.
Downloads
14
Maintainers
Readme
Introduction
AppBlocks is a tiny, fast and lightweight javascript library for building micro apps. It is designed to be used primarily as a script tag to enhance web pages with self-contained micro applications.
The goal of AppBlocks is to be a small library that provides all the necessary ingredients to develop micro apps in websites while being ridiculously easy to integrate in any project, practical and small.
Read about the AppBlocks use case.
AppBlocks at a glance
Here is a complete example of a "Hello world" app.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My first app</title>
</head>
<body>
<!-- This is the container where our app will be rendered. -->
<div id="app"></div>
<!-- This is where we put the contents of our app. -->
<template id="appTemplate">
<p title="{data.message}">{data.message}</p>
</template>
<!-- Load AppBlocks. -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/appblocks.min.js"></script>
<!-- Initialize our app. -->
<script>
var app = new AppBlock({
el: document.getElementById('app'),
template: document.getElementById('appTemplate'),
data: {
message: "Hello world!"
}
});
</script>
</body>
</html>
There's much more
Head over to the Documentation.