百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
M

Mosaic

> 编程语言
开源

一个用于构建用户界面的前端 JavaScript 库!

384 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个用于构建用户界面的前端 JavaScript 库!

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:

javascript
const name = "Mosaic";
html`
Welcome to ${name}!
`

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:

xml

  
    My Mosaic App
  
    
  

  

  

index.js:

…

Installation

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

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

or with a script tag.

xml

(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.

bash
npm install --save-dev parcel-bundler

Now you are ready to use Mosaic!

Author

  • Year: 2019
  • Programmer: Adeola Uthman
  • Languages/Tools: JavaScript, TypeScript, Parcel

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

TypeScriptcomponentsfront-endjavascriptui

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言