# @easypost/easy-ui 中文文档

规范地址：https://npmcn.com/package/%40easypost/easy-ui/

版本：1\.0\.0-alpha\.151
npm 元数据更新时间：2026-11-10T18:43:10.977Z
中文译文更新时间：2026-11-13T04:18:19.926Z
软件包许可：未声明

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

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

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

- 包体积（解压后）：7.4 MB，1384 个文件
- TypeScript 类型：未声明
- 运行依赖：16 个
- peer 依赖：react ^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0，react-is ^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0，react-dom ^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0
- 首次发布：2023-03-29T22:08:44.065Z
- 最新版本发布：2026-11-10T18:43:10.607Z
- 近 30 天下载量：3163（2026-10-13 至 2026-11-11，npm 官方下载统计）
- 已发布版本数：151（近 12 个月 48 个）

## 中文简介

[简单UI](https://github.com/EasyPost/easy-ui) 是一个组件库,旨在帮助开发人员为使用 EasyPost 的托运人创造最佳经验.

## 安装

```sh
npm install @easypost/easy-ui
```

也可以使用：`pnpm add @easypost/easy-ui`、`yarn add @easypost/easy-ui`、`bun add @easypost/easy-ui`

## README

# 简单UI

[简单UI](https://github.com/EasyPost/easy-ui) 是一个组件库,旨在帮助开发人员为使用 EasyPost 的托运人创造最佳经验.

## 开始

1.  使用 Easy UI 安装 [无](https://www.npmjs.com/) 或您的项目软件包管理器 :

```bash
npm install @easypost/easy-ui --save
```

2.  将 Easy UI CSS 文件包含在您的应用条目中 :

```js
import "@easypost/easy-ui/style.css";
```

3.  在Easy UI里播放您的应用程序 `Provider`数字 :

```js
import { Provider as EasyUIProvider } from "@easypost/easy-ui/Provider";

const root = ReactDOM.createRoot(document.getElementById("root"));
root.render(
  <EasyUIProvider>
    <App />
  </EasyUIProvider>,
);
```

4.  使用 Easy UI 组件 :

```js
import { VerticalStack } from "@easypost/easy-ui/VerticalStack";
import { Button } from "@easypost/easy-ui/Button";

function App() {
  return (
    <VerticalStack>
      <Button>Click me!</Button>
    </VerticalStack>
  );
}
```

看我们的 [故事书](https://main--63f50c7c86f6514d2e0ef4be.chromatic.com/) 详细组成部分文件.

### 字体

简单UI `Poppins` 字体。 你可以自己主持,也可以使用Google字体. 由于自己主持, `Poppins` 包含在 `.storybook/public/fonts/poppins`。 。 。 .

如果托管您自己, 请在样式表内包含此声明, 用字体所在位置替换路径 :

```css
@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src:
    url("/fonts/poppins/poppins-v20-latin-300.woff2") format("woff2"),
    url("/fonts/poppins/poppins-v20-latin-300.woff") format("woff");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src:
    url("/fonts/poppins/poppins-v20-latin-400.woff2") format("woff2"),
    url("/fonts/poppins/poppins-v20-latin-400.woff") format("woff");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src:
    url("/fonts/poppins/poppins-v20-latin-500.woff2") format("woff2"),
    url("/fonts/poppins/poppins-v20-latin-500.woff") format("woff");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src:
    url("/fonts/poppins/poppins-v20-latin-600.woff2") format("woff2"),
    url("/fonts/poppins/poppins-v20-latin-600.woff") format("woff");
}

@font-face {
  font-family: "Poppins";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src:
    url("/fonts/poppins/poppins-v20-latin-700.woff2") format("woff2"),
    url("/fonts/poppins/poppins-v20-latin-700.woff") format("woff");
}
```

### 服务器渲染

当服务器渲染一个使用 Easy UI 和 React < 18 的应用程序时, 您的应用程序必须被一个 React Aria 的单实例所包裹 `SSRProvider`。如果一个应用程序正在使用附加版本的 React Aria,确保只有一个版本的 `@react-aria/ssr` 利用国家预防机制 `overrides` 或者亚恩的 `resolutions` 属性.

## 发展

我们用"故事书"来创建一个简单的,热量重载的游乐场,用于开发这些组件.

### 图标

| 命令 | 运行 |
| :-- | :-- |
| `npm run build` | 构建工程 |
| `npm run clean` | 删除临时目录 |
| `npm run lint` | 启动项目( ESLint、 Stylelint、 Pretier) |
| `npm run test` | 测试工程 |
| `npm run test:watch` | 用手表模式测试工程 |

## 常见问题

### @easypost/easy-ui 是什么？

简单UI 是一个组件库,旨在帮助开发人员为使用 EasyPost 的托运人创造最佳经验\.

### 如何安装 @easypost/easy-ui？

在项目目录运行 npm install @easypost/easy-ui，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0）、react-is（^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0）、react-dom（^16\.14\.0 \|\| ^17\.0\.0 \|\| ^18\.0\.0 \|\| ^19\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @easypost/easy-ui 支持 TypeScript 吗？

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

### @easypost/easy-ui 可以商用吗？

@easypost/easy-ui 使用 未声明 许可。package\.json 没有声明许可证。没有许可证的代码默认保留全部权利，商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括，不构成法律意见，请以许可原文为准。

### @easypost/easy-ui 的下载量有多少？

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

### @easypost/easy-ui 还在维护吗？

最新版本 1\.0\.0-alpha\.151 发布于 2026/11/11（2 天前）；至今共发布 151 个版本，其中过去 12 个月发布了 48 个；首次发布于 2023/03/30。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

