@hareui/vue

中文文档
0.5.0发布于 2026/11/01MITTypeScriptES Module

HareUI — Vue 3 port of HeroUI v3

原始使用文档
文档目录5 节
  1. Getting Started
  2. Vite plugin (optional)
  3. Documentation
  4. Contributing
  5. License

Documentation License npm version

HareUI

Documentation: hareui.alexzvn.me

HareUI is a Vue 3 port of HeroUI v3. It pairs the accessible primitives of Reka UI with the utility-first styling of Tailwind CSS v4, and keeps HeroUI's design, tokens and component API.

  • Accessible by default: keyboard, focus and screen-reader behavior come from Reka UI
  • Tailwind CSS v4: no CSS-in-JS runtime, themeable through CSS variables
  • Same look as HeroUI: styles and tokens are translated from HeroUI v3
  • Slot-based composition: Vue slots and the as prop instead of deeply nested props
  • Zero boilerplate: components work without a plugin or provider

Getting Started

Requirements: Vue 3.5+ and Tailwind CSS v4.

npm i @hareui/vue

Add the styles to your main CSS file, after Tailwind:

@import 'tailwindcss';
@import '@hareui/vue';

Use components:

<script setup lang="ts">
import { Button } from '@hareui/vue'
</script>

<template>
  <Button>My Button</Button>
</template>

Vite plugin (optional)

@hareui/vue/vite auto-imports components in templates (through unplugin-vue-components) and applies app-wide theme overrides at build time:

// vite.config.ts
import hareui from '@hareui/vue/vite'

export default defineConfig({
  plugins: [
    vue(),
    tailwindcss(),
    hareui({
      prefix: 'H', // <HButton> / <h-button>; default '' keeps <Button>
      ui: { button: { slots: { base: 'uppercase' }, defaultVariants: { size: 'lg' } } },
    }),
  ],
})
  • prefix: template prefix for HareUI components. Kebab-case ('h-') is accepted.
  • ui: same shape as createHareUI({ ui }); must be JSON-serializable. createHareUI({ ui }), variant props, :ui and class still override it.
  • components: options forwarded to unplugin-vue-components (dts, dirs, extra resolvers, …), or false to turn auto import off.

Already registering unplugin-vue-components yourself? Add HareUIResolver({ prefix }) from @hareui/vue/vite to its resolvers instead.

Documentation

Visit hareui.alexzvn.me for theming, dark mode, styling, composition and every component. AI tools can read the docs as llms.txt or llms-full.txt.

Contributing

Issues and pull requests are welcome at github.com/alexzvn/hareui.

License

MIT. Styles, tokens and icons are derived from HeroUI; see THIRD_PARTY_LICENSES.md.

版本与发布记录

@hareui/vue 共发布 8 个版本,首次发布于 2026/10/03;过去 12 个月发布了 8 个版本。

版本发布日期距今
0.5.0latest2026/11/012 天前
0.4.02026/10/304 天前
0.3.02026/10/2410 天前
0.2.02026/10/2113 天前
0.1.32026/10/0430 天前
0.1.22026/10/031 个月前

关于 @hareui/vue 的常见问题

@hareui/vue 是什么?

haroui - HeroUI v3的Vue 3端口

如何安装 @hareui/vue?

在项目目录运行 npm install @hareui/vue,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:vue(^3.5.0)、tailwindcss(^4.3.0)、@internationalized/date(^3.12.4)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@hareui/vue 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@hareui/vue 支持 ESM 还是 CommonJS?

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

@hareui/vue 可以商用吗?

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

@hareui/vue 还在维护吗?

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