Convert Figma logo to code with AI

Tencent logoweui-wxss

A UI library by WeChat official design team, includes the most useful widgets/modules.

15,076
5,263
15,076
61

Top Related Projects

27,157

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

轻量、可靠的小程序 UI 组件库

:dog: 一套组件化、可复用、易扩展的微信小程序 UI 组件库

一套高质量的微信小程序 UI 组件库

Essential UI blocks for building mobile web apps.

Quick Overview

WeUI-WXSS is a WeChat-specific UI library developed by Tencent for creating WeChat Mini Programs. It provides a set of consistent and customizable UI components that adhere to WeChat's design guidelines, allowing developers to create native-looking WeChat Mini Program interfaces efficiently.

Pros

  • Officially supported by Tencent, ensuring compatibility with WeChat Mini Programs
  • Comprehensive set of UI components tailored for WeChat's ecosystem
  • Follows WeChat's design language, providing a native look and feel
  • Regular updates and maintenance from Tencent's team

Cons

  • Limited to WeChat Mini Program development, not suitable for other platforms
  • Customization options may be restricted to maintain consistency with WeChat's design
  • Learning curve for developers not familiar with WeChat Mini Program development
  • Dependency on WeChat's platform and potential limitations imposed by it

Code Examples

  1. Using a WeUI button:
<button class="weui-btn weui-btn_primary">Primary Button</button>
  1. Implementing a WeUI cell:
<view class="weui-cell weui-cell_access">
  <view class="weui-cell__bd">Cell Title</view>
  <view class="weui-cell__ft weui-cell__ft_in-access"></view>
</view>
  1. Creating a WeUI form:
<view class="weui-cells weui-cells_form">
  <view class="weui-cell">
    <view class="weui-cell__hd">
      <label class="weui-label">Name</label>
    </view>
    <view class="weui-cell__bd">
      <input class="weui-input" placeholder="Enter your name"/>
    </view>
  </view>
</view>

Getting Started

To use WeUI-WXSS in your WeChat Mini Program:

  1. Clone the repository:

    git clone https://github.com/Tencent/weui-wxss.git
    
  2. Copy the dist/style folder to your Mini Program project.

  3. In your WXSS file, import the WeUI styles:

    @import '/style/weui.wxss';
    
  4. Start using WeUI classes in your WXML files:

    <view class="weui-btn-area">
      <button class="weui-btn weui-btn_primary">Button</button>
    </view>
    

Competitor Comparisons

27,157

A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.

Pros of weui

  • More comprehensive UI component library for web applications
  • Supports multiple frameworks (vanilla JS, React, Vue)
  • Better suited for cross-platform web development

Cons of weui

  • Larger file size and potentially more complex implementation
  • May require additional setup for specific frameworks
  • Less optimized for WeChat Mini Program development

Code Comparison

weui (HTML/CSS):

<a href="javascript:;" class="weui-btn weui-btn_primary">Primary Button</a>
<a href="javascript:;" class="weui-btn weui-btn_default">Default Button</a>

weui-wxss (WXML/WXSS):

<button class="weui-btn" type="primary">Primary Button</button>
<button class="weui-btn" type="default">Default Button</button>

The weui-wxss code is more specific to WeChat Mini Program syntax, while weui uses standard HTML elements with CSS classes.

weui-wxss is tailored specifically for WeChat Mini Programs, offering a streamlined and optimized solution for this platform. It has a smaller file size and is easier to implement in Mini Program projects. However, it lacks the versatility of weui for broader web application development across different frameworks and platforms.

Both libraries provide a consistent WeChat-style UI, but developers should choose based on their specific project requirements and target platform.

轻量、可靠的小程序 UI 组件库

Pros of vant-weapp

  • More comprehensive component library with over 70 components
  • Better documentation and examples for each component
  • Active development and frequent updates

Cons of vant-weapp

  • Larger file size due to more components
  • Steeper learning curve for beginners
  • Less native WeChat UI feel compared to weui-wxss

Code Comparison

weui-wxss:

.weui-btn {
  position: relative;
  display: block;
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
}

vant-weapp:

.van-button {
  position: relative;
  display: inline-block;
  box-sizing: border-box;
  height: 44px;
  padding: 0;
  font-size: 16px;
  line-height: 42px;
}

The code comparison shows that vant-weapp uses a more modern CSS approach with box-sizing and specific height/line-height values, while weui-wxss focuses on basic positioning and padding. vant-weapp's approach may offer more consistent styling across different components but could be less flexible for custom designs.

Both libraries provide essential UI components for WeChat Mini Programs, but vant-weapp offers a more extensive set of components and better documentation. weui-wxss, being developed by Tencent, provides a more native WeChat look and feel. The choice between the two depends on project requirements, desired UI aesthetics, and developer preferences.

:dog: 一套组件化、可复用、易扩展的微信小程序 UI 组件库

Pros of wux-weapp

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for each component
  • Regular updates and active community support

Cons of wux-weapp

  • Larger file size and potentially higher performance overhead
  • Steeper learning curve due to more complex API and customization options
  • Less native-looking UI compared to WeUI's design philosophy

Code Comparison

weui-wxss:

<view class="weui-cells">
  <view class="weui-cell">
    <view class="weui-cell__bd">Cell Content</view>
  </view>
</view>

wux-weapp:

<wux-cell-group>
  <wux-cell title="Cell Content"></wux-cell>
</wux-cell-group>

The code comparison shows that wux-weapp uses custom components with more abstracted properties, while weui-wxss relies on class-based styling with a structure closer to standard HTML.

wux-weapp offers more flexibility and features out of the box, but weui-wxss provides a simpler, more lightweight approach that closely follows WeChat's design guidelines. The choice between the two depends on project requirements, desired customization level, and performance considerations.

一套高质量的微信小程序 UI 组件库

Pros of iview-weapp

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for each component
  • Regular updates and active community support

Cons of iview-weapp

  • Larger file size and potentially higher performance overhead
  • Less native-looking components compared to WeUI's design philosophy
  • Steeper learning curve for developers new to the framework

Code Comparison

iview-weapp:

<i-button type="primary" bind:click="handleClick">Click me</i-button>
<i-input v-model="value" placeholder="Enter text" />
<i-cell-group>
    <i-cell title="Cell Title" value="Content"></i-cell>
</i-cell-group>

weui-wxss:

<button class="weui-btn weui-btn_primary" bindtap="handleClick">Click me</button>
<input class="weui-input" placeholder="Enter text" bindinput="handleInput" />
<view class="weui-cells">
    <view class="weui-cell">
        <view class="weui-cell__bd">Cell Title</view>
        <view class="weui-cell__ft">Content</view>
    </view>
</view>

Both libraries offer solutions for creating UI components in WeChat Mini Programs, but iview-weapp provides a more extensive set of pre-built components with easier implementation, while weui-wxss offers a more lightweight and native-looking approach. The choice between them depends on the specific project requirements and developer preferences.

Essential UI blocks for building mobile web apps.

Pros of ant-design-mobile

  • More comprehensive component library with a wider range of UI elements
  • Better documentation and examples for developers
  • Active development and frequent updates

Cons of ant-design-mobile

  • Larger file size and potentially slower performance
  • Steeper learning curve due to more complex API

Code Comparison

ant-design-mobile:

import { Button } from 'antd-mobile'

const App = () => (
  <Button color='primary' size='large'>
    Submit
  </Button>
)

weui-wxss:

<button class="weui-btn weui-btn_primary">
  Submit
</button>

Summary

ant-design-mobile offers a more feature-rich and well-documented UI library for mobile web applications, while weui-wxss provides a simpler, lightweight solution specifically designed for WeChat Mini Programs. The choice between the two depends on the specific requirements of your project, such as platform compatibility, performance needs, and desired customization options.

Both libraries aim to provide a consistent and user-friendly mobile UI experience, but they cater to different ecosystems and development approaches. Consider factors like project scope, target audience, and development team familiarity when deciding between these two options.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

WeUI for 小程序 为微信小程序量身设计

npm version Gitter

概述

WeUI 是一套同微信原生视觉体验一致的基础样式库,由微信官方设计团队为微信内网页和微信小程序量身设计,令用户的使用感知更加统一。包含button、cell、dialog、 progress、 toast、article、actionsheet、icon等各式元素。

以下内容是纯UI库,如果想使用逻辑封装版本,请看小程序组件库 - WeUI

使用

  • 样式文件可直接引用dist/style/weui.wxss,或者单独引用dist/style/widget下的组件的wxss
  • 组件的wxml结构请看dist/example/下的组件

rpx版本

默认版本使用的是px。这里也提供rpx版本,文件在dist-rpx-mode目录下。

WeUI 黑暗模式

在根结点增加属性 data-weui-theme="dark" 如:

<view data-weui-theme="dark">
    ...
</view>

预览

用微信web开发者工具打开dist目录(**请注意,是dist目录,不是整个项目**)

preview

WeUI for 小程序

文档

WeUI 视觉标准参考 weui-design

License

The MIT License(http://opensource.org/licenses/MIT)

请自由地享受和参与开源

贡献

如果你有好的意见或建议,欢迎给我们提issue或pull request。

NPM DownloadsLast 30 Days