Scripts2026年7月25日·1 分钟阅读

WeUI — WeChat-Style UI Component Library for Mobile Web

A lightweight CSS library implementing WeChat's native visual design language for mobile web applications and mini-programs.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
WeUI Overview
直接安装命令
npx -y tokrepo@latest install 73f5066d-87e3-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

WeUI is an officially maintained CSS library by the WeChat design team at Tencent. It provides a consistent set of UI components that match the native look and feel of WeChat, making mobile web pages and mini-programs feel integrated with the WeChat ecosystem.

What WeUI Does

  • Provides pre-built CSS components matching WeChat's native design language
  • Covers common mobile patterns: buttons, cells, dialogs, toasts, action sheets
  • Ships form elements styled for mobile touch interactions
  • Includes icon fonts and loading spinners consistent with WeChat UX
  • Works across WeChat's in-app browser, mini-programs, and standard mobile browsers

Architecture Overview

WeUI is a pure CSS library with no JavaScript runtime dependency. The source is authored in Less and compiled to a single distributable CSS file. Components follow a BEM-like naming convention with the weui- prefix. The library is intentionally minimal so it layers cleanly on top of any JavaScript framework or vanilla HTML.

Self-Hosting & Configuration

  • Install via npm (npm install weui) or link the CDN-hosted stylesheet
  • Import weui.css or weui.min.css into your project entry point
  • Customize variables by importing the Less source and overriding tokens before compilation
  • No build tooling required for the pre-compiled CSS distribution
  • Pairs with weui.js (separate package) for interactive component behaviors like picker and slider

Key Features

  • Pixel-perfect alignment with WeChat's native UI on iOS and Android
  • Tiny footprint: the minified CSS is under 50 KB
  • Framework-agnostic: works with React, Vue, vanilla JS, or mini-program templates
  • Accessibility-friendly semantic HTML patterns
  • Active maintenance by Tencent's WeChat team with regular updates

Comparison with Similar Tools

  • Ant Design Mobile — full React component library with heavier runtime; WeUI is CSS-only and framework-agnostic
  • Vant — Vue-specific mobile component library with richer interactive widgets; WeUI focuses on matching WeChat's exact design language
  • Framework7 — cross-platform mobile UI kit with its own routing and state; WeUI is intentionally a styling layer only
  • Ionic — targets hybrid native apps with Capacitor/Cordova; WeUI targets WeChat's in-app browser and mini-programs

FAQ

Q: Does WeUI require JavaScript? A: No. The core library is pure CSS. The optional weui.js companion package adds JavaScript behaviors for components like date pickers.

Q: Can I use WeUI outside of WeChat? A: Yes. It works in any mobile browser. Components will render correctly; they just happen to match WeChat's visual style.

Q: Is WeUI compatible with WeChat mini-programs? A: Yes. Tencent also provides weui-wxss, a WXSS adaptation of WeUI specifically for the mini-program runtime.

Q: How do I customize the theme colors? A: Import the Less source files and override the color variables before compiling. The default theme matches WeChat's green accent.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产