Top Related Projects
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
轻量、可靠的小程序 UI 组件库
一套高质量的微信小程序 UI 组件库
一款基于 Taro 框架开发的多端 UI 组件库
Essential UI blocks for building mobile web apps.
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Quick Overview
WeUI for Mini Program is an official WeChat design team UI library for WeChat Mini Programs. It provides a set of basic components and styles that adhere to WeChat's design guidelines, allowing developers to create consistent and visually appealing mini programs quickly.
Pros
- Officially supported by WeChat, ensuring compatibility and adherence to platform guidelines
- Comprehensive set of UI components tailored for WeChat Mini Programs
- Regular updates and maintenance, keeping up with WeChat platform changes
- Easy to integrate and use within WeChat Mini Program projects
Cons
- Limited to WeChat Mini Program ecosystem, not suitable for other platforms
- Customization options may be restricted to maintain consistency with WeChat's design language
- Learning curve for developers not familiar with WeChat Mini Program development
- Dependency on WeChat's platform and potential limitations imposed by it
Code Examples
- Using a WeUI button component:
<button class="weui-btn weui-btn_primary">Primary Button</button>
- Implementing a WeUI cell group:
<view class="weui-cells">
<view class="weui-cell">
<view class="weui-cell__bd">Cell 1</view>
<view class="weui-cell__ft">Details</view>
</view>
<view class="weui-cell">
<view class="weui-cell__bd">Cell 2</view>
<view class="weui-cell__ft">Details</view>
</view>
</view>
- Creating a WeUI form:
<form>
<view class="weui-cells__title">Personal Information</view>
<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>
</form>
Getting Started
-
Install WeUI for Mini Program in your project:
npm install weui-miniprogram
-
Import the WeUI styles in your app.wxss file:
@import 'weui-miniprogram/weui-wxss/dist/style/weui.wxss';
-
Use WeUI components in your WXML files as shown in the code examples above.
-
For more advanced components, refer to the official documentation and examples provided in the GitHub repository.
Competitor Comparisons
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, covering a wider range of elements and layouts
- Suitable for both web and WeChat Mini Program development
- Longer development history and larger community support
Cons of weui
- Requires more setup and configuration for use in WeChat Mini Programs
- May include unnecessary components for developers focused solely on Mini Programs
- Potentially larger file size due to broader scope
Code Comparison
weui-miniprogram:
<mp-cells title="带说明的列表项">
<mp-cell value="标题文字" footer="说明文字"></mp-cell>
</mp-cells>
weui:
<div class="weui-cells__title">带说明的列表项</div>
<div class="weui-cells">
<div class="weui-cell">
<div class="weui-cell__bd">标题文字</div>
<div class="weui-cell__ft">说明文字</div>
</div>
</div>
The weui-miniprogram example uses custom components specific to Mini Programs, while the weui example uses standard HTML with CSS classes. The weui-miniprogram version is more concise but less flexible, while the weui version offers more control over the structure but requires more markup.
轻量、可靠的小程序 UI 组件库
Pros of vant-weapp
- More comprehensive component library with over 50 components
- Better documentation and examples
- More frequent updates and active community support
Cons of vant-weapp
- Larger file size due to more components
- Steeper learning curve for beginners
- May require more customization to match specific design requirements
Code Comparison
weui-miniprogram:
<mp-cells title="带说明的列表项">
<mp-cell value="标题文字" footer="说明文字"></mp-cell>
</mp-cells>
vant-weapp:
<van-cell-group title="带说明的列表项">
<van-cell title="标题文字" value="说明文字" />
</van-cell-group>
Both libraries offer similar functionality, but vant-weapp provides more customization options and a wider range of components. weui-miniprogram follows the official WeChat design guidelines more closely, which may be preferable for some projects.
vant-weapp is generally more suitable for complex applications with diverse UI requirements, while weui-miniprogram is ideal for simpler projects that prioritize adherence to WeChat's design language.
Ultimately, the choice between these libraries depends on the specific needs of your project, such as design requirements, performance considerations, and development team preferences.
一套高质量的微信小程序 UI 组件库
Pros of iview-weapp
- Offers a more extensive set of UI components, providing developers with a wider range of pre-built elements
- Provides a more customizable theming system, allowing for easier brand integration and visual consistency
- Includes more advanced components like charts and data visualization tools
Cons of iview-weapp
- Less official support and updates compared to weui-miniprogram, which is maintained by the WeChat team
- May have a steeper learning curve due to its more complex component structure and API
- Potentially larger bundle size, which could impact app performance on lower-end devices
Code Comparison
weui-miniprogram:
<mp-cells title="带说明的列表项">
<mp-cell value="标题文字" footer="说明文字"></mp-cell>
</mp-cells>
iview-weapp:
<i-cell-group>
<i-cell title="单行列表" label="附加描述" value="详细信息"></i-cell>
</i-cell-group>
Both examples show how to create a basic list item with a title and additional information. The syntax is similar, but iview-weapp offers more granular control over the content structure within the cell.
一款基于 Taro 框架开发的多端 UI 组件库
Pros of taro-ui
- Cross-platform compatibility: Supports multiple platforms including WeChat Mini Program, H5, React Native
- Rich component library: Offers a wide range of UI components for various use cases
- Active community and frequent updates: Regular releases and improvements
Cons of taro-ui
- Steeper learning curve: Requires knowledge of React and Taro framework
- Larger bundle size: May result in slightly larger app sizes due to cross-platform support
Code Comparison
weui-miniprogram:
<mp-cells title="带说明的列表项">
<mp-cell value="标题文字" footer="说明文字"></mp-cell>
</mp-cells>
taro-ui:
import { AtList, AtListItem } from 'taro-ui'
<AtList>
<AtListItem title='标题文字' note='说明文字' />
</AtList>
Summary
weui-miniprogram is specifically designed for WeChat Mini Programs, offering a lightweight and easy-to-use UI library. It closely follows WeChat's design guidelines and is ideal for developers focusing solely on the WeChat platform.
taro-ui, on the other hand, provides a more versatile solution for developers looking to create cross-platform applications. It offers a richer set of components and the flexibility to deploy on multiple platforms, but comes with a steeper learning curve and potentially larger app sizes.
The choice between the two depends on the project requirements, target platforms, and developer expertise.
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 support for React Native, enabling cross-platform development
- More frequent updates and active community contributions
Cons of ant-design-mobile
- Larger bundle size, which may impact performance on slower devices
- Steeper learning curve due to more complex API and customization options
- Less optimized for WeChat Mini Program environment
Code Comparison
weui-miniprogram:
<mp-cells title="带说明的列表项">
<mp-cell value="标题文字" footer="说明文字"></mp-cell>
</mp-cells>
ant-design-mobile:
import { List } from 'antd-mobile';
<List header='带说明的列表项'>
<List.Item extra='说明文字'>标题文字</List.Item>
</List>
The code comparison shows that weui-miniprogram uses custom elements specific to WeChat Mini Program, while ant-design-mobile uses more standard React components. This reflects the different focus and target platforms of each library.
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Pros of mand-mobile
- More comprehensive component library with over 30 UI components
- Supports both Vue.js and React frameworks
- Better documentation and examples for developers
Cons of mand-mobile
- Larger bundle size due to more components and features
- Steeper learning curve for developers new to the library
- Less specific to WeChat Mini Program environment
Code Comparison
mand-mobile (Vue.js):
<template>
<md-button type="primary" @click="handleClick">Click me</md-button>
</template>
<script>
import { Button } from 'mand-mobile'
export default {
components: { 'md-button': Button },
methods: {
handleClick() {
console.log('Button clicked')
}
}
}
</script>
weui-miniprogram:
<button class="weui-btn weui-btn_primary" bindtap="handleClick">Click me</button>
<script>
Page({
handleClick() {
console.log('Button clicked')
}
})
</script>
The code comparison shows that mand-mobile uses Vue.js component syntax, while weui-miniprogram uses WeChat Mini Program's native syntax. mand-mobile offers more flexibility in terms of framework choice, but weui-miniprogram is more tailored to the WeChat Mini Program environment.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
WeUIç»ä»¶åºç®ä»
è¿æ¯ä¸å¥åºäºæ ·å¼åºweui-wxsså¼åçå°ç¨åºæ©å±ç»ä»¶åºï¼å微信åçè§è§ä½éªä¸è´çæ©å±ç»ä»¶åºï¼ç±å¾®ä¿¡å®æ¹è®¾è®¡å¢éåå°ç¨åºå¢é为微信å°ç¨åºé身设计ï¼ä»¤ç¨æ·ç使ç¨æç¥æ´å ç»ä¸ã
å¦ä½ä½¿ç¨
详ç»ä½¿ç¨åèææ¡£
å¼å
- åå§å
npm run init
- æ§è¡å½ä»¤ï¼
npm run dev
- æ建ç»ä»¶åºï¼
npm run build
éé DarkMode
å¨æ ¹ç»ç¹ï¼æç»ä»¶çå¤å±ç»ç¹ï¼å¢å å±æ§ data-weui-theme="dark"
ï¼å³æ WeUI ç»ä»¶åæ¢å° DarkMode ç表ç°ï¼å¦:
<view data-weui-theme="dark">
...
</view>
Top Related Projects
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
轻量、可靠的小程序 UI 组件库
一套高质量的微信小程序 UI 组件库
一款基于 Taro 框架开发的多端 UI 组件库
Essential UI blocks for building mobile web apps.
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot