All Projects → Authman2 → Mosaic

Authman2 / Mosaic

Licence: mit
🎨 A front-end JavaScript library for building user interfaces!

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Mosaic

Reactshadow
🔰 Utilise Shadow DOM in React with all the benefits of style encapsulation.
Stars: ✭ 948 (+143.08%)
Mutual labels:  components, webcomponents
Bit
A tool for component-driven application development.
Stars: ✭ 14,443 (+3603.33%)
Mutual labels:  components, front-end
Calcite Components
Web Components for the Calcite Design System. Built with Stencil JS. Currently in Beta!
Stars: ✭ 96 (-75.38%)
Mutual labels:  components, webcomponents
Slim.js
Fast & Robust Front-End Micro-framework based on modern standards
Stars: ✭ 789 (+102.31%)
Mutual labels:  webcomponents, front-end
muilessium
UI Framework for simple websites - landings, blogs, etc.
Stars: ✭ 16 (-95.9%)
Mutual labels:  components, front-end
Millenniumjs
🚀 A javascript library for create Functional Stateless Components and render with Virtual DOM.
Stars: ✭ 28 (-92.82%)
Mutual labels:  components, front-end
Lab
React UI component design tool
Stars: ✭ 349 (-10.51%)
Mutual labels:  components, front-end
Frend.co
Frend — A collection of accessible, modern front-end components.
Stars: ✭ 640 (+64.1%)
Mutual labels:  components, front-end
cwco
Powerful and Fast Web Component Library with a Simple API
Stars: ✭ 27 (-93.08%)
Mutual labels:  components, webcomponents
Panel
Web Components + Virtual DOM: web standards for powerful UIs
Stars: ✭ 206 (-47.18%)
Mutual labels:  components, webcomponents
Refills
Refills is maintained by the thoughtbot design team. It is funded by thoughtbot, inc. and the names and logos for thoughtbot are trademarks of thoughtbot, inc.
Stars: ✭ 1,523 (+290.51%)
Mutual labels:  components, front-end
orgenic-ui
ORGENIC UI is an MIT-licensed open source project for creating strong user interfaces with high quality web components.
Stars: ✭ 53 (-86.41%)
Mutual labels:  components, webcomponents
Standalone
Create framework agnostic components that are truly reusable and interoperable with all the benefits of the React ecosystem – using the HTML5 custom elements API to extend HTML's vocabulary.
Stars: ✭ 205 (-47.44%)
Mutual labels:  components, webcomponents
anywhere-webcomponents
A UI work in progress based on custom elements (web components) for use in anywhere.
Stars: ✭ 17 (-95.64%)
Mutual labels:  components, webcomponents
Switzerland
🇨🇭Switzerland takes a functional approach to Web Components by applying middleware to your components. Supports Redux, attribute mutations, CSS variables, React-esque setState/state, etc… out-of-the-box, along with Shadow DOM for style encapsulation and Custom Elements for interoperability.
Stars: ✭ 261 (-33.08%)
Mutual labels:  components, webcomponents
Front End Note
📝 Web前端洞见。有深度的Web 前端内容。
Stars: ✭ 356 (-8.72%)
Mutual labels:  front-end
Westore
更好的小程序项目架构
Stars: ✭ 3,897 (+899.23%)
Mutual labels:  webcomponents
Kendo Angular
Issue tracker - Kendo UI for Angular
Stars: ✭ 352 (-9.74%)
Mutual labels:  components
Handycontrols
Contains some simple and commonly used WPF controls based on HandyControl
Stars: ✭ 347 (-11.03%)
Mutual labels:  components
Chaizi
漢語拆字字典
Stars: ✭ 384 (-1.54%)
Mutual labels:  components

Mosaic logo

npm Downloads NPM

Mosaic

Mosaic is a declarative front-end JavaScript library for building user interfaces!

💠 (Web) Component-Based: Mosaic uses the Custom Elements API to create web components that can keep track of their own data, actions, and more, and can be included in other components to create front-end web applications.

⚡️ Observable Data: Mosaic uses Observables to keep track of changes to a component's data. This means that there is no need to call "setState" or anything like that to update a component - instead just change the data directly.

🧠 Smart DOM: Updates in Mosaic work by remembering which nodes are dynamic (i.e. subject to change) and traveling directly to those nodes to make changes, rather than traversing the tree again.

🔀 Built-in Router: Comes with a basic, client-side router which allows Mosaic components to be used as separate pages.

🌐 State Manager: Comes with a built-in global state manager called Portfolio.

👌 Lightweight: The minified Mosaic library comes in at a size of 28KB.

🔖 Tagged Template Literals: Views are written using tagged template literals, which means there is no need for a compiler:

const name = "Mosaic";
html`<h1>Welcome to ${name}!</h1>`

Demo

Here is an example of a simple Mosaic application. All you need is an index.html file and an index.js file. For a more detailed example, run the project inside the "example" folder.

index.html:

<html>
  <head>
    <title>My Mosaic App</title>
  </head>
    
  <div id='root'></div>

  <script src='https://unpkg.com/[email protected]/dist/index.js'></script>
  <script type="text/javascript" src='./index.js'></script>
</html>

index.js:

// Import Mosaic
import Mosaic, { html } from 'mosaic-framework';

// Create components
Mosaic({
    name: 'my-label',
    data: {
        text: ''
    },
    view: self => {
        return html`
            <h2>${ self.data.text }</h2>
            <p>This is a custom label component!</p>
            ${self.descendants}
        `;
    }
});
const app = Mosaic({
    name: 'my-app',
    element: 'root',
    data: {
        title: "Mosaic App"
    },
    sayHello: function() {
        console.log("Hello World!!");
        console.log("This component is ", this);
    },
    view: function() {
        return html`
            <h1>This is a ${this.data.title}!</h1>
            <p>Click below to print a message!</p>
            <button onclick="${this.sayHello}">Click Me!</button>

            <my-label text='Welcome to Mosaic!'>
                Awesome, right?
            </my-label>
        `;
    }
});

// Paint the Mosaic onto the page.
app.paint();

Installation

The easiest way to use Mosaic is to first install the npm package by using:

npm install --save mosaic-framework
yarn add mosaic-framework --save

or with a script tag.

<script src='https://unpkg.com/[email protected]/dist/index.js'></script>

(Optional) For fast builds and hot reloading, install the build tool "Parcel." This is not required, though, as Mosaic uses built-in JavaScript features. This means that no build tool is required, but any may be used if it helps the overall project structure.

npm install --save-dev parcel-bundler

Now you are ready to use Mosaic!

Author

  • Year: 2019
  • Programmer: Adeola Uthman
  • Languages/Tools: JavaScript, TypeScript, Parcel
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].