@carbon/vue

中文文档
3.0.32发布于 2026/08/26Apache-2.0TypeScriptCommonJS构建来源已验证近 30 天下载 1.8万

A collection of components for the Carbon Design System built using Vue.js

原始使用文档
文档目录12 节
  1. Carbon Vue library - A Carbon Community Project
  2. Community Contributions Needed
  3. Install
  4. Add to Vue project
  5. Add to Nuxt project
  6. Vue 3
  7. Changelog
  8. List of available components
  9. Building and publishing
  10. Test publish
  11. How to run the storybook
  12. IBM Telemetry

@carbon/vue-3

Carbon is released under the Apache-2.0 license CI workflow status Maintained with Lerna PRs welcome Chat with us on Discord

Vue implementation of the Carbon Design System A collection of Carbon Components implemented using Vue logo Vue.js.

Carbon Vue library - A Carbon Community Project

The library provides front-end developers & engineers a collection of reusable Vue components to build websites and user interfaces. Adopting the library enables developers to use consistent markup, styles, and behavior in prototype and production work.

Community Contributions Needed

As a community project contributions are not only welcome, but essential for the maintenance and growth of this project.

Install

npm add @carbon/vue

or

$ yarn add @carbon/vue

Add to Vue project

src/main.js

import CarbonVue3 from '@carbon/vue';
import App from './App.vue';
const app = createApp(App);
app.use(CarbonVue3);
app.mount('#app');

See Hello Carbon Vue for an example Vue project with Carbon.

Add to Nuxt project

plugins/carbon-vue.js

import CarbonVue from '@carbon/vue';

export default defineNuxtPlugin(nuxtApp => {
  nuxtApp.vueApp.use(CarbonVue);
});

See Hello Carbon Nuxt coming soon

Vue 3

  • Vue 2 support will end on Dec 31, 2023. Learn more.
  • Upgrading from Vue 2? Check out the Migration Guide.
  • Vue 2 components can be found on the vue2 branch

Vue 3 components for Carbon 10 have reached parity with the Vue 2 components. More work is needed especially around accessibility. If you want to improve Vue 3 components follow these guidelines.

  1. Fork this repo and checkout the main branch
  2. Look to see which components are currently being improved. You can do this by looking in the issues list.
  3. If you want to improve a component, look in the open issue list to see if someone else might already be working on it. Look for issues with a "V3 - Vue3" label and the name of the component. For example "CvDatePicker - improving accessibility".
  4. If no one else is already working on it, create an issue using the "🍪 Vue 3 - improve component" and label it as above.
    • Work on the component and create a PR when you are ready.
    • Components are expected to be implemented as single file components using the Vue composition api. See CvCheckbox as an example. The Vue 2 components use the options API.
    • You should reference the DOM in the React components storybook and be sure to include any accessibility improvements that might be there.
    • You should update the story and test cases for the component if applicable. Sometimes the story might need updating almost always the test cases for the component will need updates.
    • If you have question tag @davidnixon in your issue and let me know how I can help.

Changelog

CHANGELOG.md

List of available components

View available Vue Components here. Usage information is available in the notes provided with each story.

Building and publishing

The following steps will build and publish the packages:

  • clone or download the repo;
  • run yarn to install dependencies and bootstrap the packages;
  • run yarn build to build all the packages including the storybook;

If you just want to build an individual package you can limit the scope: yarn build --scope @carbon/vue yarn build --scope storybook

To start the storybook in a local server use yarn start.

Test publish

To test publishing to a npm registry:

cd local-dev
docker-compose up
# open a new terminal
yarn build
npm add-user --registry http://0.0.0.0:4873/
# any username, password, & email will work
# try: carbon, vue, & [email protected]
yarn test:publish
# maybe change some things and try again
yarn build
yarn test:unpublish
yarn test:publish

How to run the storybook

Just follow the steps listed below and you will be able to run the storybook.

  1. After the checkout to the vNext branch, in order to install the dependencies run the command yarn install on the root;
  2. Now, run the command cd storybook to enter the storybook folder, then again run the command yarn install to install the dependencies inside the storybook folder;
  3. Finally, run the command yarn serve inside the storybook folder.

In other words, these are the commands you're going to use in order of execution:

yarn install
cd storybook
yarn serve

or

yarn install
yarn serve:storybook

IBM Telemetry IBM Telemetry

This package uses IBM Telemetry to collect de-identified and anonymized metrics data. By installing this package as a dependency you are agreeing to telemetry collection. To opt out, see Opting out of IBM Telemetry data collection. For more information on the data being collected, please see the IBM Telemetry documentation.

版本与发布记录

@carbon/vue 共发布 215 个版本,首次发布于 2019/01/12;过去 12 个月发布了 4 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
3.0.32latest2026/08/262 个月前
3.0.312026/07/074 个月前
3.0.302025/12/2310 个月前
3.0.292025/11/1711 个月前
3.0.272025/05/301.4 年前
3.0.262025/05/201.5 年前

其他发布通道:canary → 2.38.0-canary.1,next → 3.0.9-alpha.0。

关于 @carbon/vue 的常见问题

@carbon/vue 是什么?

A collection of components for the Carbon Design System built using Vue.js

如何安装 @carbon/vue?

在项目目录运行 npm install @carbon/vue,或使用 pnpm add / yarn add / bun add。

@carbon/vue 支持 TypeScript 吗?

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

@carbon/vue 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@carbon/vue 可以商用吗?

@carbon/vue 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@carbon/vue 的下载量有多少?

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

@carbon/vue 还在维护吗?

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