Top Related Projects
A lightweight, customizable Vue UI library for mobile web apps.
轻量、可靠的小程序 UI 组件库
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Essential UI blocks for building mobile web apps.
A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
Quick Overview
NutUI is a Vue.js-based UI component library developed by JD.com for mobile web applications. It offers a wide range of customizable components designed to create efficient and visually appealing mobile interfaces, with support for both Vue 2 and Vue 3.
Pros
- Comprehensive set of mobile-optimized UI components
- Supports both Vue 2 and Vue 3 frameworks
- Customizable themes and styles
- Well-documented with interactive examples
Cons
- Primarily focused on mobile web development, may not be ideal for desktop applications
- Some components may have a learning curve for developers new to the library
- Documentation is mainly in Chinese, which may be challenging for non-Chinese speakers
Code Examples
- Basic Button Component:
<template>
<nut-button type="primary" @click="handleClick">
Click me
</nut-button>
</template>
<script>
export default {
methods: {
handleClick() {
console.log('Button clicked!')
}
}
}
</script>
- Dialog Component:
<template>
<nut-cell title="Show Dialog" @click="showDialog" />
<nut-dialog
title="Dialog Title"
content="This is the dialog content"
v-model:visible="isVisible"
@cancel="onCancel"
@ok="onOk"
/>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const isVisible = ref(false)
const showDialog = () => {
isVisible.value = true
}
const onCancel = () => {
console.log('Dialog cancelled')
}
const onOk = () => {
console.log('Dialog confirmed')
}
return {
isVisible,
showDialog,
onCancel,
onOk
}
}
}
</script>
- Form Component:
<template>
<nut-form>
<nut-form-item label="Username">
<nut-input v-model="username" placeholder="Enter username" />
</nut-form-item>
<nut-form-item label="Password">
<nut-input v-model="password" type="password" placeholder="Enter password" />
</nut-form-item>
<nut-button type="primary" block @click="submitForm">Submit</nut-button>
</nut-form>
</template>
<script>
import { ref } from 'vue'
export default {
setup() {
const username = ref('')
const password = ref('')
const submitForm = () => {
console.log('Form submitted:', { username: username.value, password: password.value })
}
return {
username,
password,
submitForm
}
}
}
</script>
Getting Started
- Install NutUI in your Vue project:
npm i @nutui/nutui
- Import and use NutUI components in your Vue file:
<template>
<nut-button type="primary">NutUI Button</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui'
export default {
components: {
[Button.name]: Button
}
}
</script>
- For Vue 3 projects, you can also use the createApp method to globally register all components:
import { createApp } from 'vue'
import NutUI from '@nutui/nutui'
import '@nutui/nutui/dist/style.css'
const app = createApp(App)
app.use(NutUI)
app.mount('#app')
Competitor Comparisons
A lightweight, customizable Vue UI library for mobile web apps.
Pros of Vant
- Larger community and more frequent updates
- More comprehensive documentation and examples
- Wider range of components and features
Cons of Vant
- Larger bundle size due to more components
- Steeper learning curve for beginners
- Less focus on specific e-commerce scenarios
Code Comparison
NutUI (Vue 3 component):
<template>
<nut-button type="primary">NutUI Button</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui';
</script>
Vant (Vue 3 component):
<template>
<van-button type="primary">Vant Button</van-button>
</template>
<script>
import { Button } from 'vant';
</script>
Both libraries offer similar component usage, but Vant generally provides more customization options and props for each component. NutUI focuses on simplicity and ease of use, while Vant offers more advanced features and flexibility.
NutUI is tailored for JD's e-commerce ecosystem, making it a good choice for similar applications. Vant, being more general-purpose, is suitable for a wider range of projects but may require more configuration for specific use cases.
Overall, Vant has a larger ecosystem and more features, while NutUI offers a simpler, more focused approach for e-commerce-related projects.
轻量、可靠的小程序 UI 组件库
Pros of Vant Weapp
- More comprehensive documentation and examples
- Larger community and more frequent updates
- Better support for WeChat Mini Program development
Cons of Vant Weapp
- Limited to WeChat Mini Program ecosystem
- Steeper learning curve for developers new to WeChat Mini Programs
Code Comparison
Vant Weapp component usage:
<van-button type="primary">Button</van-button>
<van-cell-group>
<van-field label="Username" placeholder="Please enter username" />
</van-cell-group>
NutUI component usage:
<nut-button type="primary">Button</nut-button>
<nut-cell-group>
<nut-input label="Username" placeholder="Please enter username" />
</nut-cell-group>
Both libraries offer similar component structures and usage patterns, but Vant Weapp is specifically tailored for WeChat Mini Programs, while NutUI is more versatile and can be used in various frontend frameworks.
Vant Weapp provides a more specialized solution for WeChat Mini Program development, with extensive documentation and a larger community. However, this specialization limits its use outside the WeChat ecosystem. NutUI, on the other hand, offers greater flexibility and can be used across different platforms and frameworks, making it a more versatile choice for developers working on multiple types of projects.
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Pros of Mand Mobile
- More comprehensive documentation with detailed API references and examples
- Larger community and more frequent updates
- Wider range of pre-built components, including complex ones like charts and maps
Cons of Mand Mobile
- Larger bundle size, which may impact performance on slower devices
- Steeper learning curve due to more complex component structure
- Less flexibility for customization compared to NutUI's simpler approach
Code Comparison
Mand Mobile component usage:
<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>
NutUI component usage:
<template>
<nut-button type="primary" @click="handleClick">Click me</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui'
export default {
components: { 'nut-button': Button },
methods: {
handleClick() {
console.log('Button clicked')
}
}
}
</script>
Both libraries offer similar component usage patterns, but Mand Mobile uses the md-
prefix for its components, while NutUI uses nut-
. The overall structure and implementation are quite similar, making it relatively easy for developers to switch between the two if needed.
Essential UI blocks for building mobile web apps.
Pros of Ant Design Mobile
- More comprehensive documentation and examples
- Larger community and ecosystem support
- Better internationalization and accessibility features
Cons of Ant Design Mobile
- Heavier bundle size
- Steeper learning curve for beginners
- Less flexibility for customization
Code Comparison
NutUI example:
<template>
<nut-button type="primary">Primary Button</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui';
</script>
Ant Design Mobile example:
import { Button } from 'antd-mobile'
const App = () => (
<Button color='primary'>Primary Button</Button>
)
Both libraries offer similar component APIs, but Ant Design Mobile tends to have more props and configuration options for each component. NutUI's syntax is more Vue-oriented, while Ant Design Mobile is primarily designed for React applications.
NutUI focuses on lightweight and flexible components, making it easier to customize and integrate into existing projects. Ant Design Mobile, on the other hand, provides a more comprehensive set of components and design guidelines, which can be beneficial for larger projects or teams that require consistency across multiple applications.
A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
Pros of naive-ui
- More comprehensive component library with over 80 components
- Better TypeScript support and type definitions
- More active development and frequent updates
Cons of naive-ui
- Steeper learning curve due to its complexity
- Larger bundle size, which may impact performance
- Less focus on mobile-specific components
Code Comparison
NutUI (Vue 3):
<template>
<nut-button type="primary">Primary Button</nut-button>
</template>
<script>
import { Button } from '@nutui/nutui';
</script>
naive-ui (Vue 3):
<template>
<n-button type="primary">Primary Button</n-button>
</template>
<script>
import { NButton } from 'naive-ui';
</script>
Summary
NutUI is a lightweight, mobile-focused UI library, while naive-ui offers a more comprehensive set of components suitable for both desktop and mobile applications. NutUI may be preferable for simpler mobile projects, while naive-ui is better suited for complex applications requiring extensive customization and TypeScript support. Both libraries provide Vue 3 compatibility, but naive-ui offers a wider range of components and more frequent updates.
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
京ä¸é£æ ¼çè½»é级 Vue ç»ä»¶åºï¼æ¯æ移å¨ç«¯ H5 å å°ç¨åºå¼å
Nut[nÊt]ï¼æºèªçµå½±ãå°æ²³ä¸çºªãéæ¾é¼ Scrat "æ§è¿·ä¸æ"ï¼ä¸ç追æ±ï¼å³ä¾¿å¼å大ç¾é¾ä¹ç»ä¸æ¾æçåæã
ç®ä½ä¸æ | English
ç¹æ§
- ð 80+ é«è´¨éç»ä»¶ï¼è¦ç移å¨ç«¯ä¸»æµåºæ¯
- ðª æ¯æä¸å¥ä»£ç åæ¶å¼å H5+å¤ç«¯å°ç¨åº
- ð åºäºäº¬ä¸APP 10.0 è§è§è§è
- ð æ¯ææéå¼ç¨
- ð 详尽çææ¡£å示ä¾
- ðª æ¯æ TypeScript
- ðª æ¯ææå¡ç«¯æ¸²æï¼æµè¯é¶æ®µï¼
- ð æ¯æç»ä»¶çº§å«å®å¶ä¸»é¢ï¼å ç½® 700+ 个åé
- ð å½é åæ¯æï¼å·²æ¯æè±æï¼å°å°¼è¯åç¹ä½ä¸æ
- ð åå æµè¯è¦ççè¶ è¿ 80%ï¼ä¿é稳å®æ§
- ð æä¾ Sketch 设计èµæº
ææ¡£
å®ç½ï¼nutui.jd.com
@nutui/nutuiï¼éç¨äºç§»å¨ç«¯ H5 页é¢å¼å
@nutui/nutui-taroï¼æ¯æå¼å Taro å¤ç«¯å°ç¨åºï¼å¾®ä¿¡ãæ¯ä»å®ã京ä¸çå°ç¨åºï¼å Taro-H5 项ç®
é¾æ¥
å®æ¹çæ
ç± NutUI å®æ¹å¢éç»´æ¤ç项ç®å¦ä¸ï¼
é¡¹ç® | æè¿° | çæ¬ |
---|---|---|
@nutui/nutui | NutUI 移å¨ç«¯ H5 çæ¬ | |
@nutui/nutui-taro | NutUI Taro å¤ç«¯çæ¬ | |
@nutui/icons-vue | @nutui/nutui 使ç¨çå¾æ åº | |
@nutui/icons-vue-taro | @nutui/nutui-taro 使ç¨çå¾æ åº | |
@nutui/touch-emulator | å¨æ¡é¢ç«¯ä½¿ç¨ NutUI çè¾ å©åº | |
@nutui/auto-import-resolver | unplugin-auto-import æ件ç resolver é
ç½® | |
@nutui/playground | NutUI å¨çº¿ Playground | - |
nutui-demo | NutUI å®æ¹ç¤ºä¾åé | - |
社åºçæ
ç±ç¤¾åºç»´æ¤ç项ç®å¦ä¸ï¼æ¬¢è¿è¡¥å ï¼
é¡¹ç® | æè¿° |
---|---|
nutui-uniapp | åºäº NutUI 4.x çæ¬å¼åç uni-app ç»ä»¶åº |
jwaterwater/uni-nutui | åºäº NutUI 3.x çæ¬å¼åç uni-app ç»ä»¶åº |
common-intellisense | æä¾ NutUI 4.x çæ¬æºè½æ示ç vscode æ件 |
项ç®ç¶æ
使ç¨æ¡ä¾
NutUI å·²ç»æå ¥äºæ们çç产ç¯å¢ä¸ä½¿ç¨ï¼ä¸çä¹å¨å¹¿æ³å°ä½¿ç¨ NutUI å¼åå¤ç«¯åºç¨ã
å¼å交æµ
微信群 | å é¨åå群 |
---|---|
æ·»å 好å并åå¤ãNutUI Vueã | 82957939 |
åä¸å ±å»º
NutUI 社åºå ±å»ºå¡è®®
NutUI éæ¨å ±å»ºï¼Contributor æ¨å¥½
为 NutUI è´¡ç®ä»£ç
NutUI çå ±å»ºæ¹å主è¦å为ï¼è§£å³ issueãä¿®å¤ bugãæ°å¢ç»ä»¶ãå¢å å½é åãUI å®å¶ãå¹³å°éé ã跨端æ©å±çã
欢è¿ç¤¾åºå¼åè åä¸å ±å»ºï¼å¨è´¡ç®æ¨ç代ç ä¹å请å é 读 ãNutUI è´¡ç®æåãã
é®é¢åé¦ä¸å»ºè®®
å¨åé¦é®é¢ä¹åï¼æ¨èé 读 ãæé®çæºæ §ãããå¦ä½åå¼æºç¤¾åºæé®é¢ãåãå¦ä½ææå°æ¥å Bugãï¼è¿æ ·æ¨è½å¤æ´å®¹æè·å¾ç解å帮å©ã
å¦ææ¨æä»»ä½æ³æ³ãçé®æ建议ï¼é½å¯ä»¥åä¸ç¤¾åºè®¨è®ºå享æ¨çè§ç¹ã
è´¡ç®è 们
æ谢以ä¸ææç» NutUI è´¡ç®è¿ä»£ç ç å¼åè ã
æ´æ°æ¥å¿
æ¥é Releaseã
License
GitHub Stargazaers
Top Related Projects
A lightweight, customizable Vue UI library for mobile web apps.
轻量、可靠的小程序 UI 组件库
💰 A mobile UI toolkit, based on Vue.js 2, designed for financial scenarios.
Essential UI blocks for building mobile web apps.
A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
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