Skip to content
mantou132Public

About

💎 Build reusable custom elements and web apps on Web Components

Topics

Resources

Stars

55 stars

Watchers

0 watching

Forks

Repository files navigation

Gem

Read in other languages: English | 中文

A Web Components framework and application toolchain. Build reusable custom elements, UI libraries and complete web apps with browser-native technologies — from small reactive elements to SSR/SSG applications.

Why Gem

  • Start small, scale up. Add reactive behavior to a custom element with Gem's decorators and APIs. Use GemElement and HTML template rendering when you need a component model.
  • Standards-first components. Gem elements are native Custom Elements. Use Shadow DOM for isolated components, or Light DOM when app-level CSS integration matters.
  • A path from components to apps. Use @mantou/gem for reactive elements, templates, routing, history and Store. GemKit builds on Gem with file-based routing, layouts, server data, actions, API routes, i18n, SSR and SSG.
  • Work with the ecosystem you have. gem-port generates React, Vue and Svelte wrappers. GemKit is built on Rsbuild.
  • Keep the browser responsive. @async() lets elements render in slices and yield to the main thread.

Get started with GemKit

Create a full-stack Gem application:

npm create gemkit@latest my-app
cd my-app
npm install
npm run dev

Or start with the Gem guide if you want to build individual custom elements first.

How the pieces fit together

flowchart TB
    Core["Gem core<br/>Reactive elements · Templates · Store"]
    SSR["gem-ssr<br/>Server rendering and hydration"]
    Swc["swc-plugin-gem<br/>SWC transform"]
    Build["unplugin-gem<br/>Build plugin"]
    Kit["GemKit<br/>File routes · Layouts · API routes · SSR · SSG"]
    Analyzer["gem-analyzer<br/>Element analysis"]
    Book["Gem Book<br/>Documentation sites"]
    Port["gem-port<br/>React · Vue · Svelte wrappers"]
    Tap["Tap UI<br/>Mobile-first UI library"]
    Duoyun["Duoyun UI<br/>Desktop UI library"]

    Core --> SSR --> Kit
    Swc --> Build --> Kit
    Kit --> Book
    Core --> Analyzer
    Analyzer --> Book
    Analyzer --> Port
    Core --> Tap --> Duoyun
Loading

Documentation

Ecosystem

Project Description
Gem Core reactive Web Components framework
GemKit Rsbuild-based application framework: file routing, layouts, server data, actions, API routes, i18n, SSR and SSG
gem-ssr Server rendering and hydration
gem-port React, Vue and Svelte wrappers for Gem elements
Duoyun UI · Tap UI Desktop and mobile-first UI libraries built with Gem
DevTools · Analyzer Debugging and component analysis
TypeScript tools TypeScript language support
unplugin-gem · swc-plugin-gem Build plugins for Vite/Webpack/Rollup/esbuild/Rspack/Rolldown and SWC
Zed · VS Code Editor extensions

Roadmap.

Contribution

Fork the repository and open a pull request.

About

💎 Build reusable custom elements and web apps on Web Components

Topics

Resources

Stars

55 stars

Watchers

0 watching

Forks

Used by

Contributors

Languages