Top Related Projects
Essential UI blocks for building mobile web apps.
轻量、可靠的小程序 UI 组件库
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
:dog: 一套组件化、可复用、易扩展的微信小程序 UI 组件库
一套高质量的微信小程序 UI 组件库
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Quick Overview
Taro UI is a comprehensive UI component library for Taro, a cross-platform framework for building applications that can run on multiple platforms including WeChat Mini Program, H5, and React Native. It provides a set of high-quality components that are consistent across different platforms, helping developers create beautiful and responsive user interfaces efficiently.
Pros
- Cross-platform compatibility, ensuring consistent UI across different platforms
- Rich set of pre-built components, reducing development time and effort
- Customizable themes and styles to match brand requirements
- Active community and regular updates
Cons
- Learning curve for developers new to Taro ecosystem
- Limited customization options for some complex components
- Potential performance overhead due to cross-platform nature
- Dependency on Taro framework, which may limit flexibility in some cases
Code Examples
- Using a basic Button component:
import { Button } from 'taro-ui'
const MyComponent = () => {
return <Button type='primary'>Primary Button</Button>
}
- Implementing a Form with input and submit:
import { AtForm, AtInput, AtButton } from 'taro-ui'
const FormExample = () => {
const [value, setValue] = useState('')
const handleSubmit = () => {
console.log('Submitted value:', value)
}
return (
<AtForm onSubmit={handleSubmit}>
<AtInput
name='value'
title='Name'
type='text'
placeholder='Please input your name'
value={value}
onChange={setValue}
/>
<AtButton type='primary' formType='submit'>Submit</AtButton>
</AtForm>
)
}
- Creating a custom TabBar:
import { AtTabBar } from 'taro-ui'
const TabBarExample = () => {
const [current, setCurrent] = useState(0)
return (
<AtTabBar
tabList={[
{ title: 'Home', iconType: 'home' },
{ title: 'Profile', iconType: 'user' },
{ title: 'Settings', iconType: 'settings' }
]}
onClick={setCurrent}
current={current}
/>
)
}
Getting Started
To start using Taro UI in your Taro project:
- Install Taro UI:
npm install taro-ui
- Import the components in your Taro page or component:
import { AtButton } from 'taro-ui'
- Use the component in your JSX:
const MyPage = () => {
return (
<View>
<AtButton type='primary'>Hello, Taro UI!</AtButton>
</View>
)
}
- Import the Taro UI styles in your app's entry file (usually
app.js
orapp.tsx
):
import 'taro-ui/dist/style/index.scss'
Now you're ready to use Taro UI components in your Taro project!
Competitor Comparisons
Essential UI blocks for building mobile web apps.
Pros of Ant Design Mobile
- Larger community and more frequent updates
- Comprehensive documentation with live examples
- Wider range of components and customization options
Cons of Ant Design Mobile
- Steeper learning curve due to more complex API
- Larger bundle size, which may impact performance
- Less focus on cross-platform development
Code Comparison
Ant Design Mobile:
import { Button } from 'antd-mobile';
const MyComponent = () => (
<Button color='primary' size='large'>
Click me
</Button>
);
Taro UI:
import { AtButton } from 'taro-ui';
const MyComponent = () => (
<AtButton type='primary' size='normal'>
Click me
</AtButton>
);
Both libraries offer similar component structures, but Ant Design Mobile generally provides more props and customization options. Taro UI's syntax is often simpler and more straightforward, which can be beneficial for developers new to the framework.
While Ant Design Mobile is primarily focused on React Native development, Taro UI is designed to work seamlessly with the Taro framework, allowing for cross-platform development across various mini-program platforms and React Native.
Ultimately, the choice between these libraries depends on the specific project requirements, target platforms, and developer preferences.
轻量、可靠的小程序 UI 组件库
Pros of vant-weapp
- Larger community and more frequent updates
- More comprehensive component library with 70+ components
- Better documentation and examples
Cons of vant-weapp
- Limited to WeChat Mini Program development
- Less flexibility for customization compared to Taro UI
Code Comparison
vant-weapp:
<van-button type="primary">Button</van-button>
<van-cell-group>
<van-field label="Username" placeholder="Please enter username" />
</van-cell-group>
Taro UI:
<AtButton type='primary'>Button</AtButton>
<AtForm>
<AtInput name='value' title='Username' placeholder='Please enter username' />
</AtForm>
Summary
vant-weapp is a popular UI component library specifically designed for WeChat Mini Program development. It offers a wide range of components and frequent updates, making it a solid choice for WeChat-specific projects. However, it lacks the cross-platform capabilities of Taro UI.
Taro UI, built on the Taro framework, provides more flexibility for developing across multiple platforms, including WeChat Mini Programs, H5, and React Native. While it may have fewer components, it offers greater customization options and the ability to create consistent UIs across different platforms.
Choose vant-weapp for WeChat-focused projects with extensive component needs, or Taro UI for cross-platform development and greater customization flexibility.
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
Pros of WeUI
- Officially supported by Tencent, ensuring long-term maintenance and updates
- Extensive documentation and examples for easy implementation
- Larger community and wider adoption, leading to more resources and support
Cons of WeUI
- Limited to WeChat Mini Program development, less versatile than Taro UI
- Less customizable and flexible compared to Taro UI's component system
- Slower release cycle and feature updates
Code Comparison
WeUI (button component):
<button class="weui-btn weui-btn_primary">Primary Button</button>
Taro UI (button component):
import { AtButton } from 'taro-ui'
<AtButton type='primary'>Primary Button</AtButton>
Key Differences
- WeUI uses traditional CSS classes for styling, while Taro UI leverages React-like components
- Taro UI offers more advanced features and customization options
- WeUI is specifically designed for WeChat Mini Programs, whereas Taro UI supports multiple platforms
Use Cases
- Choose WeUI for native WeChat Mini Program development with a focus on simplicity
- Opt for Taro UI when building cross-platform applications or requiring more advanced UI components
:dog: 一套组件化、可复用、易扩展的微信小程序 UI 组件库
Pros of wux-weapp
- Native WeChat Mini Program component library, ensuring better performance and compatibility
- Extensive collection of components specifically designed for WeChat Mini Programs
- Simpler setup and integration for WeChat-specific projects
Cons of wux-weapp
- Limited to WeChat Mini Program development, lacking cross-platform capabilities
- Smaller community and potentially slower updates compared to Taro UI
- Less flexibility for customization across different frameworks
Code Comparison
wux-weapp:
<wux-button size="small" type="light">Light</wux-button>
<wux-button size="default" type="stable">Stable</wux-button>
<wux-button size="large" type="positive">Positive</wux-button>
Taro UI:
import { AtButton } from 'taro-ui'
<AtButton size='small' type='secondary'>Secondary</AtButton>
<AtButton type='primary'>Primary</AtButton>
<AtButton size='small' type='primary'>Primary</AtButton>
wux-weapp is tailored specifically for WeChat Mini Programs, offering native components and simpler integration for WeChat-centric projects. However, it lacks cross-platform capabilities and may have a smaller community compared to Taro UI. Taro UI, being part of the Taro ecosystem, provides cross-platform support and potentially more frequent updates, but may have slightly more complex setup for WeChat-only projects. The code comparison shows similar button implementations, with wux-weapp using custom element tags and Taro UI using imported React-like components.
一套高质量的微信小程序 UI 组件库
Pros of iview-weapp
- Specifically designed for WeChat Mini Program development
- Extensive set of UI components tailored for mobile interfaces
- Lightweight and optimized for mini program performance
Cons of iview-weapp
- Limited to WeChat Mini Program ecosystem
- Less frequent updates compared to Taro UI
- Smaller community and fewer third-party extensions
Code Comparison
iview-weapp:
<i-button type="primary" bind:click="handleClick">Click me</i-button>
<i-input value="{{ value }}" bind:change="handleChange"></i-input>
Taro UI:
import { AtButton, AtInput } from 'taro-ui'
<AtButton type='primary' onClick={this.handleClick}>Click me</AtButton>
<AtInput value={this.state.value} onChange={this.handleChange} />
Summary
iview-weapp is a UI component library specifically designed for WeChat Mini Programs, offering a wide range of mobile-optimized components. It excels in its focus on the WeChat ecosystem but is limited to that platform. Taro UI, on the other hand, provides a more versatile solution for cross-platform development, supporting multiple frameworks and platforms beyond WeChat Mini Programs. The code comparison shows the slight differences in syntax and usage between the two libraries, with iview-weapp using a more HTML-like approach and Taro UI following a React-like component structure.
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Pros of mand-mobile
- More comprehensive component library with 30+ UI components
- Better support for Vue.js applications
- More active development and frequent updates
Cons of mand-mobile
- Limited cross-platform support compared to Taro UI
- Steeper learning curve for developers new to Vue.js
- Less flexibility for customization in non-Vue environments
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>
Taro UI (React):
import { AtButton } from 'taro-ui'
const MyComponent = () => {
const handleClick = () => {
console.log('Button clicked')
}
return <AtButton type='primary' onClick={handleClick}>Click me</AtButton>
}
Both libraries offer similar functionality, but mand-mobile is tailored for Vue.js applications, while Taro UI is designed for cross-platform development using React. mand-mobile provides a more extensive set of components, but Taro UI offers greater flexibility across different platforms and frameworks.
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
Taro UI
ä¸æ¬¾åºäº Taro
æ¡æ¶å¼åçå¤ç«¯ UI ç»ä»¶åº
ç¹æ§
- åºäº
Taro
å¼å UI ç»ä»¶ - ä¸å¥ç»ä»¶å¯ä»¥å¨
微信å°ç¨åº
ï¼æ¯ä»å®å°ç¨åº
ï¼ç¾åº¦å°ç¨åº
ï¼H5
ï¼ReactNative
å¤ç«¯éé è¿è¡ - æä¾å好ç APIï¼å¯çµæ´»ç使ç¨ç»ä»¶
å ³äº Taro
Taro æ¯ç± å¹å¸å®éªå®¤ å¾åæé çå¤ç«¯å¼å解å³æ¹æ¡ãç°å¦ä»å¸é¢ä¸ç«¯çå½¢æå¤ç§å¤æ ·ï¼WebãReactNativeã微信å°ç¨åºçåç§ç«¯å¤§è¡å ¶éï¼å½ä¸å¡è¦æ±åæ¶å¨ä¸åç端é½è¦æ±ææ表ç°çæ¶åï¼é对ä¸åç端å»ç¼åå¤å¥ä»£ç çææ¬æ¾ç¶é常é«ï¼è¿æ¶ååªç¼åä¸å¥ä»£ç å°±è½å¤éé å°å¤ç«¯çè½åå°±æ¾å¾æ为éè¦ã
ä½¿ç¨ Taroï¼æ们å¯ä»¥åªä¹¦åä¸å¥ä»£ç ï¼åéè¿ Taro çç¼è¯å·¥å ·ï¼å°æºä»£ç åå«ç¼è¯åºå¯ä»¥å¨ä¸å端ï¼å¾®ä¿¡å°ç¨åºãH5ãRNçï¼è¿è¡ç代ç ã
ä½éª
请使ç¨å¾®ä¿¡æ«ä¸æ«ä»¥ä¸ä½éªç
ç¸å ³é¾æ¥
å®è£
2.x
å½ Taro çæ¬ < 3 æ¶ï¼ä½¿ç¨ 2.x çæ¬
$ npm install taro-ui@2.3.4
3.x
å½ Taro çæ¬ â¥ 3 æ¶ï¼ä½¿ç¨ 3.x çæ¬
$ npm install taro-ui@latest
使ç¨
å¨ä»£ç ä¸ import
éè¦çç»ä»¶å¹¶æç
§æ档说æ使ç¨
import { AtButton } from 'taro-ui'
å¼å交æµ
å¼å计å
路线å¾
è´¡ç®
å¦æä½ å¨ä½¿ç¨ Taro UI
æ¶éå°é®é¢ï¼æè
æ好ç建议ï¼æ¬¢è¿ç»æ们æ Issue
æ Pull Request
ãå¨å¼å§ä¹åï¼è¯·é
读 è´¡ç®æå
License
MIT
Top Related Projects
Essential UI blocks for building mobile web apps.
轻量、可靠的小程序 UI 组件库
A UI library by WeChat official design team, includes the most useful widgets/modules in mobile web applications.
:dog: 一套组件化、可复用、易扩展的微信小程序 UI 组件库
一套高质量的微信小程序 UI 组件库
💰 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