harmo-ui

中文文档
0.1.1发布于 2026/11/04MITES Module零依赖

Copy Harmo's components and styles into your project, and make them yours.

原始使用文档
文档目录5 节
  1. Use
  2. Commands
  3. Updates
  4. Learn more
  5. License

harmo-ui

Copy the components of Harmo, a CSS-first UI library for dashboards and applications, into your project, with their styles, and make them yours.

Use

From your project's root:

npx harmo-ui add tabs

That copies Tabs, its styles, and whatever it needs:

src/components/harmo/
  harmo.css
  tokens.css
  tabs/Tabs.tsx
  tabs/TabNav.tsx
  tabs/useTabsMotion.ts
  tabs/tabs.css
  provider/HarmoProvider.tsx
  lib/children.ts
  lib/withClass.ts

Import harmo.css once, in your root layout or entry file. It lists the tokens and each component's styles, and npx harmo-ui add keeps it up to date. Then use the component:

import "@/components/harmo/harmo.css";
import { Tabs, TabList, Tab, TabPanel } from "@/components/harmo/tabs/Tabs";

@/ is the path alias a default Next.js project sets up. Without one, use a relative path.

The files are yours to change, and only React is left to depend on. They need React 19.3 or later and TypeScript.

Commands

CommandEffect
npx harmo-ui add <component...>Copies components, with their styles and what they need
npx harmo-ui add --allCopies every component
npx harmo-ui listLists the components
Option for addEffect
-p, --path <folder>Where to copy them. By default components/harmo, or src/components/harmo if the project has a src folder. Pass it each time you use another folder
-o, --overwriteReplaces files that differ from Harmo's, without asking
--dry-runShows what would change, and changes nothing

Updates

Copied files don't update on their own, so they don't get Harmo's fixes either. To take a newer version, run npx harmo-ui@latest add <component>. It never replaces a file you've changed without asking, and files it can't ask about stay as they are.

For updates through your package manager instead, install the packages:

bun add @harmo-ui/css @harmo-ui/react

Choose one way for a project: copied components and installed ones each have their own HarmoProvider, so a project using both needs to wrap its app in both.

Learn more

  • Components: each one's props, under its React section
  • Theming: change the copied tokens.css, or override its custom properties

Harmo is at 0.x, so its APIs may still change between releases.

License

MIT

版本与发布记录

harmo-ui 共发布 2 个版本,首次发布于 2026/11/04;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.1.1latest2026/11/04今天
0.0.0-stage2026/11/04今天

关于 harmo-ui 的常见问题

harmo-ui 是什么?

将Harmo的组件和样式复制到您的项目中,并使它们成为您的。

如何安装 harmo-ui?

在项目目录运行 npm install harmo-ui,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 harmo-ui,可以用 npx harmo-ui 直接运行。

harmo-ui 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/harmo-ui 是否存在。

harmo-ui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

harmo-ui 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=20。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

harmo-ui 可以商用吗?

harmo-ui 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

harmo-ui 还在维护吗?

最新版本 0.1.1 发布于 2026/11/04(今天);至今共发布 2 个版本,其中过去 12 个月发布了 2 个;首次发布于 2026/11/04。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。