explaingit

tencent/omi

13,261TypeScriptAudience · developerComplexity · 3/5Setup · easy

TLDR

Omi is a TypeScript web framework from Tencent that builds UI components using the browser's built-in Web Components standard, so your components work natively in the browser and alongside React, Vue, or no framework at all.

Mindmap

mindmap
  root((omi))
    Core idea
      Web Components
      Native browser support
      Works without frameworks
    Component styles
      Class components
      Function components
      JSX syntax
    Reactivity
      Signal system
      Auto re-render
    Ecosystem
      Router
      Form library
      TDesign components
      Tailwind starter
    Tooling
      CLI scaffolding
      Vite build tool
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Build a reusable UI component library that works in any project regardless of which framework it uses

USE CASE 2

Create a single-page app using Omi's built-in router without committing to React or Vue

USE CASE 3

Add reactive, auto-updating custom HTML elements to an existing HTML page without a full framework rewrite

USE CASE 4

Use TDesign Web Components to quickly assemble a polished admin dashboard with pre-built UI pieces

Tech stack

TypeScriptJavaScriptJSXViteTailwind CSS

Getting it running

Difficulty · easy Time to first run · 30min

In plain English

Omi is a web framework from Tencent for building user interfaces using Web Components, which is a browser-native standard for creating reusable custom HTML elements. Instead of relying on a framework like React or Vue to manage your components, Omi components become actual custom HTML tags that browsers understand natively, meaning they can work alongside other frameworks or be used without any framework at all. The framework supports writing components using JSX, which is a notation where you write what looks like HTML tags directly inside your JavaScript code. You can use either a class-based approach or simple functions to define components. Reactivity, meaning the ability for the screen to automatically update when data changes, is handled through a signal system: you create a signal around a value, and any component that reads that value will re-render when it changes. Omi comes with a collection of companion packages that cover most common needs when building a web application: a router for single-page apps, a form library, icon sets, animation directives, and a Tailwind CSS starter template. There is also a component library called TDesign Web Components that provides pre-built UI pieces. Setting up a new project is done through a command-line tool that generates a starter project with Vite as the build tool and TypeScript as the default language. Several starter templates are available depending on whether you want a single-page app, Tailwind integration, or a simpler setup. The project is maintained by Tencent and is open source. Documentation, a live playground, and over 100 starter templates are hosted at a dedicated site.

Copy-paste prompts

Prompt 1
Build an Omi counter component using signals so the count updates automatically whenever the value changes
Prompt 2
Create an Omi single-page app with a router that navigates between a home page and a detail page using TypeScript
Prompt 3
Show me how to write an Omi class component and a function component that do the same thing, so I can compare the two styles
Prompt 4
Set up a new Omi project with Vite and Tailwind CSS using the CLI starter template
Prompt 5
Build a reusable Omi modal component that can be imported and used in a plain HTML page without any framework
Open on GitHub → Explain another repo

← tencent on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.