@box/blueprint-web-assets

中文文档
5.15.0发布于 2026/11/06SEE LICENSE IN LICENSETypeScriptCommonJS零依赖近 30 天下载 7.2万
原始使用文档

Blueprint Web assets @box/blueprint-web-assets

@box/blueprint-web-assets is a comprehensive collection of Box assets(icons, illustrations) and tokens (color, font, spacing, etc..). You can check available assets in our Portal.

Installation

yarn add @box/blueprint-web-assets

Usage

Tokens

In scss files:

If possible, use css variables:

@use '@box/blueprint-web-assets/tokens/tokens-css-vars.scss';
...

.component {
    background-color: var(--background-background);
}

Otherwise, you can use scss tokens, but bear in mind that this method is deprecated:

@use '@box/blueprint-web-assets/tokens/tokens.scss'; // or @import if you're not using dart sass

...

.component {
    background-color: tokens.$background-background;
}

In tsx files:

import { BackgroundBackground } from '@box/blueprint-web-assets/tokens/tokens';

...

<Checkmark color={BackgroundBackground} />

Currently we also distribute '@box/blueprint-web-assets/tokens/px-tokens' - js file containing tokens in pixel values. You should use it only if your use case doesn't support rem units, e.g. e-mail clients.

Assets

You can use all icons as regular React components.

import { InfoBadge } from '@box/blueprint-web-assets/icons/Line';

...

<InfoBadge />

To change icon color you can use color prop:

import { Alert } from '@box/blueprint-web-assets/icons/Fill';
import { IconIconErrorOnLight } from '@box/blueprint-web-assets/tokens/tokens';
...

<Alert color={IconIconErrorOnLight} />

Icon path defines icon style:

import { InfoBadge } from '@box/blueprint-web-assets/icons/Line';
import { Alert } from '@box/blueprint-web-assets/icons/Fill';
import { FileAudio } from '@box/blueprint-web-assets/icons/Content';
import { BoxLogo } from '@box/blueprint-web-assets/icons/Logo';
import { Compass } from '@box/blueprint-web-assets/icons/Multitone';

How to update assets and tokens

yarn exec nx run blueprint-web-assets:build-assets

Push changes to a new branch. New version of package will be released after merge.

Project scripts

  • nx test blueprint-web-assets to execute unit tests via Jest
  • nx lint blueprint-web-assets to execute lint via ESLint

版本与发布记录

@box/blueprint-web-assets 共发布 670 个版本,首次发布于 2024/02/06;过去 12 个月发布了 407 个版本。

版本发布日期距今
5.15.0latest2026/11/062 天前
5.14.32026/11/062 天前
5.14.22026/11/052 天前
5.14.12026/11/053 天前
5.14.02026/11/053 天前
5.13.102026/11/044 天前

关于 @box/blueprint-web-assets 的常见问题

如何安装 @box/blueprint-web-assets?

在项目目录运行 npm install @box/blueprint-web-assets,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^17.0.0 || ^18.0.0)、react-dom(^17.0.0 || ^18.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@box/blueprint-web-assets 支持 TypeScript 吗?

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

@box/blueprint-web-assets 支持 ESM 还是 CommonJS?

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

@box/blueprint-web-assets 可以商用吗?

@box/blueprint-web-assets 使用 SEE LICENSE IN LICENSE 许可。许可条款写在包内的独立文件中,请阅读该文件确认可否商用。以上为概括,不构成法律意见,请以许可原文为准。

@box/blueprint-web-assets 的下载量有多少?

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

@box/blueprint-web-assets 还在维护吗?

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