@felix-health/vue-components-vue3

中文文档
5.0.2发布于 2026/11/05MITTypeScriptESM + CJS近 30 天下载 7984

A vite based monorepo that contains all of Felix Health's vue components and documentation for those components. Currently supports Vue 3.

原始使用文档
文档目录16 节
  1. To consume in a project
  2. Project Structure
  3. Project local setup
  4. Install dependencies
  5. Set up Git hooks (Husky)
  6. Building for production
  7. Consuming locally in another project
  8. Testing
  9. Format files
  10. If you get an error about dependency being too new
  11. Contributing
  12. Adding a net new component
  13. Component Documentation (Developing with Storybook)
  14. Tools for component development
  15. Typescript support
  16. Publishing to npm

Felix Health Vue Component Library

A vite based monorepo that contains all of Felix Health's vue components and documentation for those components. Currently supports Vue 3.

To consume in a project

Currently this project depends on TailwindCSS (and our Tailwind design system). Ensure to install that within your project as a pre-requisite.

  1. Install the package
npm i @felix-health/vue-components-vue3
  1. Import the library css into your main css file:
/* Vue 3 */
@import '@felix-health/vue-components-vue3/dist/style.css';
  1. Import all of the components in your main js file:
/* Vue 3 */
import * as FelixComponents from '@felix-health/vue-components-vue3';

// Global registration in your main.js/App.vue file
Object.entries(FelixComponents).forEach((name, component) => {
  Vue.component([name, component]);
});

⚠️ Note: if you want to support server rendering, there are some components that depend on objects like document or window that are not available on the server. If you want to use this in an SSR context, you may not be able to just import all components at once as per the above, but will have to identify those components and import them separately in a client only context.

Project Structure

vue-components/
├── src/
│   ├── index.ts              # Main entry point (exports all components)
│   ├── components/            # All Vue components
│   │   └── ...
│   ├── assets/               # Styles, fonts, and static assets
│   ├── lib/                  # Utility functions and helpers
│   └── setupTests.ts         # Test configuration
├── dist/                     # Build output (generated)
├── .storybook/              # Storybook configuration
├── vite.config.ts           # Vite build configuration
├── vitest.config.ts         # Test configuration
├── tsconfig.json            # TypeScript configuration
├── package.json             # Package metadata and dependencies
└── README.md

Project local setup

Install dependencies

npm install

Set up Git hooks (Husky)

After installing dependencies, set up the Git hooks for automated linting and formatting:

npm run prepare

This will configure Husky to run lint-staged on pre-commit, which automatically formats your staged files with Prettier.

Building for production

npm run build

Consuming locally in another project

1. Build vue-components package

## Build with hot reload
npm run build:watch

2. Install package

from either Charm or Lucky directory: npm i /[path-to-project] (example npm i ../vue-components if your folder is called "vue-components")

Testing

We use Vue Testing Library with Vitest for unit testing. To write a new test, add a .spec.js file next to the component file you're working in.

npm run test

Format files

Files are automatically formatted on commit using lint-staged and husky (after running npm run prepare).

You can also manually format files:

# checks files for formatting issues
npm run format:check
# fixes formatting issues
npm run format:write

If you get an error about dependency being too new

You can bypass the minimum release age requirement this way:

npm config set min-release-age 0
npm install <package-name>
# Then set it back
npm config set min-release-age <original value in .npmrc>

Contributing

Adding a net new component

There are a few choices to make when introducing a new component / making changes to an existing one. Follow these steps when deciding where to put your new component:

1. Decide if the component is intended to be shared between applications Is the component considered a "building block" and intended to be shared between our applications? If not, consider adding your component directly in the application it's being used in instead of adding it to the library.

2. Create new component Create component inside src/components in the directory that best suits it (or create a new directory)

3. Write component documentation and tests Ensure you write a storybook story to document your new component or changes. More information on how to do this in the section below.

4. Add component to the export files Once done, add the component to src/index.ts as an export.

Component Documentation (Developing with Storybook)

Write Storybook stories in component driven development and construct components that are loosely-coupled and reusable. Emphasize the separation of concerns among components while improving our documentation.

Get started easily with our Plop boilerplate templates.

  1. Start Storybook
    • npm run storybook
  2. Run npm run plop and select the right template based on the component you are working on.
  3. Look for the newly created stories file in Storybook and develop your component by adding more stories to it.
  4. Document your component as much as possible using JSDocs documentation comments. Storybook will automatically pick them and add them to the documentation.

Building for production

Vue 3 npm run storybook:build

To test the builds: npx http-server ./path/to/build

Tools for component development

If you are developing a component that manages lots of variants, cva(class-variance-authority) is available for you to use. Also, consider using tailwind-merge if you use cva by simply using the cn(short for className) utility function in packages/vue-3/src/lib/utils.ts. Checkout AppButton component for more details.

Typescript support

Typescript support is only available for vue-3. If you are creating new components, please add it to both index.js and src/index.ts as src/index.ts is the main file to export typescript types.

Publishing to npm

  1. Head to https://github.com/Felix-Health/vue-components/actions
  2. Run the "Publish Vue 3 Package to npm" workflow off the main branch

版本与发布记录

@felix-health/vue-components-vue3 共发布 258 个版本,首次发布于 2023/12/19;过去 12 个月发布了 58 个版本。

版本发布日期距今
5.0.2latest2026/11/058 天前
5.0.12026/11/0311 天前
5.0.02026/11/0212 天前
4.0.12026/10/2223 天前
4.0.02026/09/221 个月前
3.9.02026/09/151 个月前

其他发布通道:beta → 3.7.7-beta.2。

关于 @felix-health/vue-components-vue3 的常见问题

@felix-health/vue-components-vue3 是什么?

A vite based monorepo that contains all of Felix Health's vue components and documentation for those components. Currently supports Vue 3.

如何安装 @felix-health/vue-components-vue3?

在项目目录运行 npm install @felix-health/vue-components-vue3,或使用 pnpm add / yarn add / bun add。

@felix-health/vue-components-vue3 支持 TypeScript 吗?

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

@felix-health/vue-components-vue3 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@felix-health/vue-components-vue3 需要什么版本的 Node.js?

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

@felix-health/vue-components-vue3 可以商用吗?

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

@felix-health/vue-components-vue3 的下载量有多少?

根据 npm 官方下载统计,@felix-health/vue-components-vue3 在 2026/10/15 – 2026/11/13 这 30 天内被下载 7,984 次,日均约 266 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@felix-health/vue-components-vue3 还在维护吗?

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