Skip to content

安装

全局安装、按需安装、配置

全局安装

可以使你在nextui-vue命名空间下使用所有组件。

bash
npm install nextui-vue
bash
pnpm install nextui-vue
bash
yarn install nextui-vue
bash
bun install nextui-vue

按需安装

仅安装你需要的组件,请参考每个组件的文档以了解如何安装。

TIP

使用按需安装前请确保你已经完成了主题配置

主题配置

安装HeroUI主题。

bash
npm install @heroui/theme
bash
pnpm install @heroui/theme
bash
yarn install @heroui/theme
bash
bun install @heroui/theme

由于HeroUI基于TailwindCSS,因为你还需要安装它,参考TailwindCSS的安装步骤

WARNING

仅支持TailwindCSS V3及以下的版本,不支持V4,相关issue

然后在你的tailwind.config.js文件中添加如下代码:

js
// tailwind.config.js
const { heroui } = require('@heroui/theme')

/** @type {import('tailwindcss').Config} */
module.exports = {
  content: [
    './node_modules/@heroui/theme/dist/**/*.{js,ts,jsx,tsx}'
  ],
  theme: {
    extend: {},
  },
  darkMode: 'class',
  plugins: [heroui()]
}

MIT Licensed