Post

Nextjs + HeroUI 工程

Nextjs + HeroUI 工程

Nextjs 官方文档:https://nextjs.org/docs/app/getting-started/installation#quick-start

HeroUI官方文档:https://heroui.com/en/docs/react/getting-started/quick-start

创建Nextjs工程

1
2
3
npx create-next-app@latest my-app --yes
cd my-app
npm run dev

添加HeroUI依赖

1
npm i @heroui/styles @heroui/react

globals.css 中导入 HeroUI 的CSS

1
2
@import "tailwindcss";
@import "@heroui/styles"; 

引入测试

1
2
3
4
5
6
7
8
9
import { Button } from '@heroui/react';

function App() {
  return (
    <Button>
      My Button
    </Button>
  );
}
This post is licensed under CC BY 4.0 by the author.