Convert Figma logo to code with AI

jd-opensource logonutui

京东风格的移动端 Vue 组件库,支持多端小程序(A Vue.js UI Toolkit for Mobile Web)

6,205
834
6,205
141

Top Related Projects

23,249

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.

16,355

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

  1. 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>
  1. 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>
  1. 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

  1. Install NutUI in your Vue project:
npm i @nutui/nutui
  1. 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>
  1. 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

23,249

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.

16,355

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 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

logo

京东风格的轻量级 Vue 组件库,支持移动端 H5 和 小程序开发

PRs Welcome coverage license

GitHub contributors GitHub commit activity GitHub closed issues GitHub commits since latest release (by date) GitHub Release Date jsdelivr

NutUI      


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/nutuiNutUI 移动端 H5 版本nutui
@nutui/nutui-taroNutUI Taro 多端版本nutui
@nutui/icons-vue@nutui/nutui 使用的图标库nutui
@nutui/icons-vue-taro@nutui/nutui-taro 使用的图标库nutui
@nutui/touch-emulator在桌面端使用 NutUI 的辅助库nutui
@nutui/auto-import-resolverunplugin-auto-import 插件的 resolver 配置nutui
@nutui/playgroundNutUI 在线 Playground-
nutui-demoNutUI 官方示例合集-

社区生态

由社区维护的项目如下,欢迎补充:

项目描述
nutui-uniapp基于 NutUI 4.x 版本开发的 uni-app 组件库
jwaterwater/uni-nutui基于 NutUI 3.x 版本开发的 uni-app 组件库
common-intellisense提供 NutUI 4.x 版本智能提示的 vscode 插件

项目状态

Alt

使用案例

NutUI 已经投入了我们的生产环境中使用,业界也在广泛地使用 NutUI 开发多端应用。

NutUI

更多案例

开发交流

微信群内部咚咚群
添加好友并回复「NutUI Vue」82957939

参与共建

NutUI 社区共建倡议

NutUI 邀您共建,Contributor 您好

为 NutUI 贡献代码

NutUI 的共建方向主要分为:解决 issue、修复 bug、新增组件、增加国际化、UI 定制、平台适配、跨端扩展等。

欢迎社区开发者参与共建,在贡献您的代码之前请先阅读 《NutUI 贡献指南》。

问题反馈与建议

给 NutUI 提 Issue

在反馈问题之前,推荐阅读 《提问的智慧》、《如何向开源社区提问题》和《如何有效地报告 Bug》,这样您能够更容易获得理解和帮助。

参与 NutUI 社区讨论

如果您有任何想法、疑问或建议,都可以参与社区讨论分享您的观点。

贡献者们

感谢以下所有给 NutUI 贡献过代码的 开发者。

contributors

更新日志

查阅 Release。

License

MIT

GitHub Stargazaers

stargazers

NPM DownloadsLast 30 Days