@carbon/ibm-products-web-components

中文文档
0.51.0发布于 2026/10/28Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 1.5万

Carbon for IBM Products Web Components

原始使用文档
文档目录8 节
  1. Getting started
  2. 📦 Installing Carbon for IBM Products web components
  3. Usage
  4. 📖 API Documentation
  5. Building and running Storybook locally
  6. 🙌 Contributing
  7. 📝 License
  8. IBM Telemetry

@carbon/ibm-products-web-components

Carbon for IBM Products web components

Getting started

If you’re just getting started and looking to browse our web components, take a look at our Storybook.

📦 Installing Carbon for IBM Products web components

To use Carbon for IBM Products web components, all you need to do is install the @carbon/ibm-products-web-components package.

$ yarn add @carbon/ibm-products-web-components

# or

$ npm install @carbon/ibm-products-web-components

Then you can import the component styles in your index.js.

import '@carbon/ibm-products/css/index.min.css';

Usage

To use a component, you can import it directly from the package:

import '@carbon/ibm-products-web-components/es/components/about-modal.js';

Once you've imported the component modules, you can use the components in the same manner as native HTML tags:

<c4p-about-modal
  closeIconDescription="Close"
  copyrightText="Copyright © IBM Corp. 2025"
  .title="IBM Product Name"
  .version="0.0.0"
></c4p-about-modal>

📖 API Documentation

If you're looking for @carbon/ibm-products-web-components API documentation, check out:

Building and running Storybook locally

To get started, run the following commands and Storybook will be built and then served on port 3000 on your local machine.

If this is your first time running web components in Storybook, run the following commands:

yarn
yarn build

Then run Storybook:

yarn storybook-wc

🙌 Contributing

We're always looking for contributors to help us fix bugs, build new features, or help us improve the project documentation. If you're interested, definitely check out our Contributing Guide! 👀

📝 License

Licensed under the Apache 2.0 License.

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/ibm-products-web-components 共发布 148 个版本,首次发布于 2024/10/09;过去 12 个月发布了 51 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.51.0latest2026/10/2812 天前
0.51.0-rc.0next2026/10/2812 天前
0.50.02026/10/1426 天前
0.50.0-rc.02026/10/1227 天前
0.49.02026/09/301 个月前
0.49.0-rc.02026/09/281 个月前

其他发布通道:canary → 0.3.0-canary.80,next → 0.51.0-rc.0。

关于 @carbon/ibm-products-web-components 的常见问题

@carbon/ibm-products-web-components 是什么?

Carbon for IBM Products Web Components

如何安装 @carbon/ibm-products-web-components?

在项目目录运行 npm install @carbon/ibm-products-web-components,或使用 pnpm add / yarn add / bun add。

@carbon/ibm-products-web-components 支持 TypeScript 吗?

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

@carbon/ibm-products-web-components 支持 ESM 还是 CommonJS?

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

@carbon/ibm-products-web-components 可以商用吗?

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

@carbon/ibm-products-web-components 的下载量有多少?

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

@carbon/ibm-products-web-components 还在维护吗?

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