@acronis-platform/ui-react

中文文档
6.0.0发布于 2026/11/03MITTypeScriptES Module构建来源已验证近 30 天下载 2448

Acronis React component library — a Base UI implementation, themed by @acronis-platform/design-tokens.

原始使用文档
文档目录4 节
  1. Install
  2. Usage
  3. Fonts
  4. Develop

@acronis-platform/ui-react

The Acronis React component library — a Base UI implementation, themed by @acronis-platform/tokens-pd (generated from @acronis-platform/design-tokens).

This package is under active development toward v1 and grows component by component. See AGENTS.md for conventions.

Install

pnpm add @acronis-platform/ui-react react react-dom

Usage

import '@acronis-platform/ui-react/styles';
import { Button, Switch } from '@acronis-platform/ui-react';

export function Example() {
  return (
    <div>
      <Button variant="default">Save</Button>
      <Switch defaultChecked />
    </div>
  );
}

@acronis-platform/ui-react/styles loads the acronis token base. To switch theme at runtime:

/* base brand */
@import '@acronis-platform/ui-react/styles';

/* optional: layer another brand override on top */
@import '@acronis-platform/tokens-pd/css/deep_sky_itkontoret.css';
<!-- light/dark mode -->
<html data-theme="dark"></html>

Light/dark is driven by light-dark() + color-scheme; dark: utilities are wired to [data-theme='dark'].

Fonts

The design tokens use Inter as the default family, and the generated CSS emits a graceful fallback stack (font-family: Inter, system-ui, sans-serif). The library deliberately does not bundle the font — loading it is the consumer's choice, so you control hosting, subsets, and weights.

To render in Inter, self-host it (recommended — no third-party CDN, GDPR-safe). @fontsource/inter (SIL Open Font License) is the simplest route:

pnpm add @fontsource/inter
// Load only the weights you use (the typography scale uses 400/500/600/700).
import '@fontsource/inter/400.css';
import '@fontsource/inter/500.css';
import '@fontsource/inter/600.css';
import '@fontsource/inter/700.css';

import '@acronis-platform/ui-react/styles';

The static @fontsource/inter registers the family as Inter, which matches the token output. The variable package @fontsource-variable/inter registers Inter Variable instead, so it won't match font-family: Inter without an extra alias — prefer the static package unless you add that mapping yourself.

If you skip this step, text falls back to system-ui / the platform sans-serif.

Develop

pnpm --filter @acronis-platform/ui-react storybook   # explore components
pnpm --filter @acronis-platform/ui-react test        # Vitest + RTL
pnpm --filter @acronis-platform/ui-react build       # library bundle + types

版本与发布记录

@acronis-platform/ui-react 共发布 63 个版本,首次发布于 2026/06/23;过去 12 个月发布了 63 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
6.0.0latest2026/11/034 天前
5.5.92026/10/2711 天前
5.5.82026/10/2712 天前
5.5.72026/10/2018 天前
5.5.62026/10/1424 天前
5.5.52026/10/0830 天前

关于 @acronis-platform/ui-react 的常见问题

@acronis-platform/ui-react 是什么?

Acronis React component library — a Base UI implementation, themed by @acronis-platform/design-tokens.

如何安装 @acronis-platform/ui-react?

在项目目录运行 npm install @acronis-platform/ui-react,或使用 pnpm add / yarn add / bun add。

@acronis-platform/ui-react 支持 TypeScript 吗?

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

@acronis-platform/ui-react 支持 ESM 还是 CommonJS?

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

@acronis-platform/ui-react 可以商用吗?

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

@acronis-platform/ui-react 的下载量有多少?

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

@acronis-platform/ui-react 还在维护吗?

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