@commerce7/admin-ui

中文文档
2.0.72发布于 2026/11/04MITTypeScriptCommonJS近 30 天下载 1.2万

Commerce7 Admin UI Component Library

原始使用文档
文档目录9 节
  1. Installation
  2. Inter Font
  3. Setup
  4. Usage
  5. Linking and Unlinking for Local Packages
  6. Linking
  7. Unlinking
  8. Release Notes
  9. Instructions for Updating packages

Commerce7 Admin UI


Installation

To install and save in your package.json dependencies, run:

npm install @commerce7/admin-ui

Inter Font

Commerce7 Admin UI was designed to be used with Inter, available for free from Google Fonts. Inter can be included in your application inside of HTML or from NPM.

In HTML:

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

With NPM:

npm install @fontsource/inter
import "@fontsource/inter/400.css";
import "@fontsource/inter/500.css";
import "@fontsource/inter/600.css";

Setup

Wrap your application with Commerce7AdminUI:

import React from 'react';
import { Commerce7AdminUI } from '@commerce7/admin-ui';
import App from './App'

function Index() {
    return (
        <Commerce7AdminUI>
            <App/>
        </Commerce7AdminUI>
    );
}

Usage

Import components individually to use them inside your application:

import React from 'react';
import { Button } from '@commerce7/admin-ui';

function SaveButton() {
    return <Button>Hello World</Button>;
}

Linking and Unlinking for Local Packages

At times in may be required to link a project to admin-ui locally for development testing purposes. To do this have 2 terminals open. One terminal should be in the root of your local folder of the admin ui package and the other should be in the root to the project you would like to use the local package in. VS code should also be open.

Examples used here are admin and admin-ui.

Linking

In admin-ui terminal
1. npm link
In admin terminal
2. npm link @commerce7/admin-ui@{version-number}
In VS code
3. Restart VS code
4.After rebooting VS code, the @commerce7/admin-ui folder in the admin/@node_modules should have an arrow icon beside it. This shows it is properly linked.
In admin
5. In order to test locally, add **path.resolve('./node_modules/@commerce7/admin-ui/node_modules')** to webpack.{project-name}.config.js. Ex:  webpack.admin.dev.js
6. Run npm run frontend-admin
In admin-ui
5. When you change something in admin-ui and want to see the changes in admin, you need to run  **npm run build** in admin-ui to sync with admin. After you run **npm run build**, when you have symbolic link, the admin page will automatically be refreshed and will get the latest changes.

Unlinking


In admin terminal
1. npm unlink --no-save @commerce7/admin-ui@{version-number}


In admin-ui terminal
2. npm unlink @commerce7/admin-ui@{version-number}


In VS code
3. Restart VS code


In VS code in admin project
4. Run npm install

After restarting the arrow icon should be removed. This means the project has successfully be unlinked from the local version of admin ui.

Release Notes

When changing the package version, add a matching entry at the top of src/stories/Releases.mdx. Explain why the package is being updated and follow the existing format.

Instructions for Updating packages

Dont update the following:

  • styled-components

版本与发布记录

@commerce7/admin-ui 共发布 463 个版本,首次发布于 2021/01/27;过去 12 个月发布了 43 个版本。

版本发布日期距今
2.0.72latest2026/11/046 天前
2.0.712026/11/046 天前
2.0.702026/10/2911 天前
2.0.692026/10/2417 天前
2.0.682026/10/2318 天前
2.0.672026/10/2318 天前

其他发布通道:beta → 2.0.0-beta.10。

关于 @commerce7/admin-ui 的常见问题

@commerce7/admin-ui 是什么?

Commerce7 Admin UI Component Library

如何安装 @commerce7/admin-ui?

在项目目录运行 npm install @commerce7/admin-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.1.0)、react-dom(^19.1.0)、styled-normalize(^8.1.1)、styled-components(^5.3.11)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@commerce7/admin-ui 支持 TypeScript 吗?

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

@commerce7/admin-ui 支持 ESM 还是 CommonJS?

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

@commerce7/admin-ui 可以商用吗?

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

@commerce7/admin-ui 的下载量有多少?

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

@commerce7/admin-ui 还在维护吗?

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