Front End Cross-Frameworks Framework.

Usage no npm install needed!

<script type="module">
  import omi from '';


English | 简体中文


Omi - Front End Cross-Frameworks Framework

With TypeScript

import { tag, WeElement, h, extractClass } from 'omi'
import * as css from './index.scss'

interface Props {
  size?: 'medium' | 'small' | 'mini',
  type?: 'primary' | 'success' | 'warning' | 'danger' | 'info' | 'text'
  plain?: boolean,
  round?: boolean,
  circle?: boolean,
  loading?: boolean,
  disabled?: boolean,
  icon?: string,
  autofocus?: boolean,
  nativeType?: 'button' | 'submit' | 'reset',
  block?: boolean
  text?: string

export default class Button extends WeElement<Props>{
  static css = css

  static defaultProps = {
    plain: false,
    round: false,
    circle: false,
    loading: false,
    disabled: false,
    autofocus: false,
    nativeType: 'button',
    block: false

  static propTypes = {
    size: String,
    type: String,
    plain: Boolean,
    round: Boolean,
    circle: Boolean,
    loading: Boolean,
    disabled: Boolean,
    icon: String,
    autofocus: Boolean,
    nativeType: String,
    block: Boolean,
    text: String

  render(props) {
    return <button disabled={props.disabled} {...extractClass(props, 'o-button', {
      ['o-button-' + props.type]: props.type,
      ['o-button-' + props.size]: props.size,
      'is-plain': props.plain,
      'is-round': props.round,
      'is-disabled': props.disabled,
      'is-block': props.block
    })} type={props.nativeType} >
      {props.loading && <i class='icon-loading'></i>}


Cross-Frameworks and Cross-Themes UI Components powered by Omi

Name Status Example Docs
@omiu/button omiu-button-status CodePen Button Docs
@omiu/icon omiu-icon-status Icon Online Icon Docs
@omiu/tabs omiu-tabs-status CodePen Tabs Docs
@omiu/radio omiu-radio-status CodePen Radio Docs
@omiu/link omiu-link-status CodePen Link Docs
@omiu/checkbox omiu-checkbox-status CodePen Checkbox Docs
@omiu/hamburger-menu omiu-hamburger-menu-status CodePen HamburgerMenu Docs
@omiu/input omiu-input-status CodePen Input Docs
@omiu/tree omiu-tree-status CodePen Tree Docs
@omiu/pagination omiu-pagination-status CodePen Pagination Docs
@omiu/loading omiu-loading-status CodePen Loading Docs
@omiu/toast omiu-toast-status CodePen Toast Docs
@omiu/action-sheet omiu-action-sheet-status CodePen ActionSheet Docs
@omiu/switch omiu-switch-status CodePen Switch Docs
@omiu/color-picker omiu-color-picker-status CodePen ColorPicker Docs
@omiu/chart omiu-chart-status CodePen Chart Docs
@omiu/toggle-icon omiu-toggle-icon-status CodePen ToggleIcon Docs
@omiu/o-icon omiu-o-icon-status CodePen OIcon Docs
@omiu/badge omiu-badge-status CodePen Badge Docs
@omiu/avatar omiu-avatar-status CodePen Avatar Docs
@omiu/breadcrumb omiu-breadcrumb-status CodePen Breadcrumb Docs
@omiu/bottom-nav omiu-bottom-nav-status CodePen BottomNav Docs
@omiu/transition omiu-transition-status CodePen Transition Docs
@omiu/dialog omiu-dialog-status CodePen Dialog Docs
@omiu/dialog-extention omiu-dialog-extention-status CodePen DialogExtention Docs

Ecosystem of Omi


Project Description
omi-docs and codepen and Omi official documents
omix 小程序全局状态管理框架,数据触手可及,状态无处遁形
omim Cross frameworks and themes components.(DOCS & REPL && JOIN US!)
omi-kbone 使用 omi + kbone 多端开发(小程序和Web)的贪吃蛇游戏。
omio Omi for old browsers with same api(IE8+)
omis Omis + React
omi-ssr Server-side rendering(support omio only)
omi-router Omi official router in 1KB js
omi-cli Project scaffolding. → Base Templates and → Other Templates
omi-devtools Browser DevTools extension
omiu Simple Omi UI
omil Webpack loader for Omi.js components.(DOCS)
omi-snippets A beautify VSCode extension for .omi or .eno file, Install now!
obaa or JSONPatcherProxy Observe or Proxy any object's any change
#### :snake:Snake MVP
Project Description
omi-snake & → Touch the demo The Snake-Eating Game Based on MVP Architecture Written by Omi
omi-kbone-snake omi-kbone 写的 MVP 架构的跨端贪吃蛇游戏,支持小程序和 H5
Preact-snake & → Touch the demo The Snake-Eating Game Based on MVP Architecture Written by Preact + Preact-CSS + Omis
[P]react-snake & → Touch the demo The Snake-Eating Game Based on MVP Architecture Written by React/Preact
omix-snake The Snake-Eating Game Based on MVP Architecture Written by Omix
#### :+1:Mini Program(小程序)
Project Description
omix 小程序全局状态管理框架,数据触手可及,状态无处遁形
react-kbone 直接使用 React 开发小程序或 Web,基于 kbone
preact-kbone 直接使用 Preact 开发小程序或 Web,基于 kbone
omi-cloud 小程序•云开发
omip 直接使用 Omi 开发小程序或 H5 SPA
mps 原生小程序增强框架(JSX + Less 输出 WXML + WXSS),也支持 QQ 轻应用
cax 小程序 Canvas 和 SVG 渲染引擎
omi-mp 通过微信小程序开发和生成 Web 单页应用(H5 SPA)
westore 小程序状态管理
comi 小程序代码高亮和 markdown 渲染组件
wx-touch-event 基于 AlloyFinger 改造的小程序手势解决方案


Project Description
omi-piano Build piano with Omi and Omi Snippets, Enjoy now!
omi-chart Simple HTML5 Charts using chart-x tag.
md2site Static Site Generator with markdown powered by Omio.
omi-30-seconds Useful Omi snippets that you can understand in 30 seconds.
omi-canvas Perfect fusion of web components, jsx and canvas.
omi-swiper Omi + Swiper
omi-vscode VSCode extension for omi, Install now!
omi-ex Omi.js extension(TypeScript)
omi-transform Omi / css3transform integration. Made css3 transform super easy in your Omi project.
omi-finger Support touch and gesture events in your Omi project.
omi-touch Smooth scrolling, rotation, pull to refresh and any motion for the web.
omi-native Render web components to native
omi-i18n Internationalization solution for omi.js using i18next ecosystem
omi-page Tiny client-side router by page
omie Build cross platform desktop apps with Omi.js and Electron.js
omi-cv Create a front-end engineer curriculum vitae, Get Started!
Soo Has same API as omi but is great alternative if you want to create custom elements without JSX, virtual DOM and store
CEE Fork from custom-elements-everywhere

Why Omi?

  • Tiny size and High performance
  • Cross frameworks(react, preact, vue, angular), components of omi are pure custom elements
  • One framework. Mobile & desktop & mini program
  • Stateless View Architecture Design
  • Be friendly to custom elements, you can pass false attributes to elements through string '0' or string 'false', you can pass object attributes to elements through : prefix and Omi.$
  • Easy two way binding by extend api
  • Supports TypeScript
  • Reactive data-binding
  • Native tap event support
  • Having Cross-frameworks UI components - omim
  • Excellent compatibility(IE8+) with omio
  • Enhanced CSS, rpx unit support base on 750 screen width
  • Compliance with browser trend and API design
  • Merge Web Components, JSX into one framework
  • Web Components can also be a data-driven view, UI = fn(data).
  • JSX is the best development experience (code intelligent completion and tip) UI Expression with least grammatical noise and it's turing complete(template engine is not, es template string is but grammatical noise is too loud)
  • Look at Facebook React vs Web Components,Omi combines their advantages and gives developers the freedom to choose the way they like
  • Shadow DOM or Light DOM merges with Virtual DOM, Omi uses both virtual DOM and real Shadow DOM to make view updates more accurate and faster
  • Scoped CSS's best solution is Shadow DOM, the community churning out frameworks and libraries for Scoped CSS (using JS or JSON writing styles such as Radium, jsxstyle, react-style; binding to webpack using generated unique className filename-classname-hash, such as CSS Modules, Vue), are hack technologies; and Shadow DOM Style is the perfect solution.
  • The original Path Updating store system. Proxy-based automatic accurate update, low power consumption, high degree of freedom, excellent performance, easy integration of requestIdleCallback,It will automatically update UI partially when data is changed

Compare TodoApp by Omi and React, Omi and React rendering DOM structure:

Omi React Omio
Omi React Omio

Omi uses Shadow DOM or Light DOM based style isolation and semantic structure.

Useful Resources

Title Name Other language Related
Web Components bookmarks
Snake-Eating Game Making with Web Components of Omi and MVP Architecture
Constructable Stylesheets: seamless reusable styles
Web Components specifications
Web Components in a Nutshell
Using Web Components with React in 2019
Using Web Components in React
Styling We Components Using A Shared Style Sheet
Developer Tools support for Web Components in Firefox 63
Develop W3C Web Components with WebAssembly
60FPS Animation In Omi 简体中文 한국어
Render Web Components To Native 简体中文 한국어
Shadow Dom In Depth 简体中文
Part Theme Explainer 求翻译
Web Components MDN 简体中文
Web Components Google
Web Components Org
Web Components: the Right Way
Proxy MDN 简体中文 한국어
CSS Variables 简体中文 한국어
CSS Shadow Parts
Platform HTML5
Using requestIdleCallback 简体中文 A polyfill
The Power Of Web Components 简体中文
ShadowRoot 简体中文


Build a example:

npm start example_name

Build omi:

npm run build

Unit testing

npm run test

Core Maintainers

Please contact us for any questions.



MIT © Tencent