# @comicrelief/component-library 中文文档

规范地址：https://npmcn.com/package/%40comicrelief/component-library/

版本：8\.90\.0
npm 元数据更新时间：2026-11-09T12:38:38.030Z
中文译文更新时间：2026-11-10T11:47:33.011Z
软件包许可：ISC

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40comicrelief/component-library
原文对照：https://npmcn.com/package/%40comicrelief/component-library/?lang=original
项目主页：https://github.com/comicrelief/component-library#readme
源码仓库：https://github.com/comicrelief/component-library

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：36.8 MB，587 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：未声明
- 运行依赖：18 个
- peer 依赖：react \>=18，react-dom \>=18，styled-components \>=6
- 首次发布：2019-06-28T11:00:02.956Z
- 最新版本发布：2026-11-09T12:38:37.568Z
- 近 30 天下载量：5021（2026-10-11 至 2026-11-09，npm 官方下载统计）
- 已发布版本数：652（近 12 个月 146 个）

## 中文简介

漫画救济部分图书馆 - - - - - - - - - - - - ----

## 安装

```sh
npm install @comicrelief/component-library
```

也可以使用：`pnpm add @comicrelief/component-library`、`yarn add @comicrelief/component-library`、`bun add @comicrelief/component-library`

## README

## 漫画救济部分图书馆

[![GitHub Actions](https://github.com/comicrelief/component-library/actions/workflows/main.yml/badge.svg)](https://github.com/comicrelief/component-library/actions) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)

### 最近重建说明(2026年6月):

-   不再在例文件中导入 Javascript faff 标记下, 只是简单的 React 组件示例 .
-   仅有例外的是每个组件下方可见的代码示例——它们使用Vite特定导入特性构建: `import buttonExampleSrc from '../components/Atoms/Button/ButtonExample.jsx?raw';`
-   样式-组件 5 QQ 样式组件 6 - 轻微语法变化. 以前在嵌入式CSS中使用嵌入式选择器/"( &)"的使用被假定. 现在它需要明确(像正常的本地CSS).
-   删除了 TriggerConfetti.js 文件 。 我找不到任何用法 可能是私人帮手不再需要了.

### 一般使用

#### 主要依赖关系

-   维特
-   样式组件

#### 安装软件包

```
$ yarn add @comicrelief/component-library
```

#### 将您的应用程序包装为主题

```
import { ThemeProvider, crTheme } from '@comicrelief/component-library';
```

#### 在应用程序的 HTML 中装入字体

我们使用安东和蒙特塞拉特字体。 把这些添加到您的前端 `index.html` `<head>`数字 :

```
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
  rel="stylesheet"
  href="https://fonts.googleapis.com/css2?family=Anton&family=Montserrat:wght@400;500;600;700&display=swap"
/>
```

#### 导入组件

```
import { HeroBanner } from '@comicrelief/component-library';
```

### 开发

要在本地安装 CR- CL, 请运行 :

```
$ yarn install
```

要启动 Dev 构建和服务器 :

```
$ yarn dev
```

测试:

```
$ yarn test:unit
```

_测试将贯穿所有Jest测试,并观看快照的任何变化._

要更新工作带来的预期变化:

```
$ yarn test:unit:update
```

发表

```
$ yarn publish:npm
```

### 测试

安装 Playwright :

```
yarn playwright install
```

运行测试 :

```
yarn test:e2e:local
```

## 常见问题

### @comicrelief/component-library 是什么？

漫画救济部分图书馆 - - - - - - - - - - - - ----

### 如何安装 @comicrelief/component-library？

在项目目录运行 npm install @comicrelief/component-library，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（\>=18）、react-dom（\>=18）、styled-components（\>=6）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @comicrelief/component-library 支持 TypeScript 吗？

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

### @comicrelief/component-library 支持 ESM 还是 CommonJS？

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

### @comicrelief/component-library 可以商用吗？

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

### @comicrelief/component-library 的下载量有多少？

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

### @comicrelief/component-library 还在维护吗？

最新版本 8\.90\.0 发布于 2026/11/09（今天）；至今共发布 652 个版本，其中过去 12 个月发布了 146 个；首次发布于 2019/06/28。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

