@lincyaw/aegis-ui

中文文档
0.7.0发布于 2026/11/02TypeScriptESM + CJS构建来源已验证

AegisLab shared design system: tokens, primitives, layout, AntD theme.

原始使用文档
文档目录3 节
  1. Install
  2. Usage
  3. Documentation

@lincyaw/aegis-ui

Design system and multi-app shell for AegisLab front ends: design tokens, presentational React components, PageWrapper, the router-aware AegisShell, and an Ant Design theme that follows the same tokens.

The package contains no API clients, business state or pages. Applications provide their own data and plug into the shell through the AegisApp contract.

Install

pnpm add @lincyaw/aegis-ui

Peer dependencies: react 18, react-dom 18, react-router-dom 6, antd 5.25 or later, @ant-design/icons 5.

Fonts are not bundled. Install @fontsource-variable/geist, @fontsource-variable/hanken-grotesk, @fontsource-variable/noto-sans-sc and @fontsource/google-sans-code, and import them once in the app entry (Google Sans Code as its 400.css and 500.css weights).

Usage

import {
  type AegisApp,
  AegisShell,
  ThemeProvider,
  getAegisTheme,
  useTheme,
} from '@lincyaw/aegis-ui';
import '@lincyaw/aegis-ui/style.css';
import { ConfigProvider } from 'antd';
import { BrowserRouter } from 'react-router-dom';

const containersApp: AegisApp = {
  id: 'containers',
  label: 'Containers',
  icon: <HddOutlined />,
  basePath: '/containers',
  sidebar: [{ items: [{ to: '', label: 'List', end: true }] }],
  routes: [{ path: '', element: <ContainerList /> }],
};

function Root() {
  const { resolved } = useTheme();
  return (
    <ConfigProvider theme={getAegisTheme(resolved)}>
      <BrowserRouter>
        <AegisShell
          brand={{ name: 'AegisLab', href: '/' }}
          apps={[containersApp]}
          fallbackPath="/containers"
        />
      </BrowserRouter>
    </ConfigProvider>
  );
}

export function App() {
  return (
    <ThemeProvider>
      <Root />
    </ThemeProvider>
  );
}

The shell wraps each route in PageWrapper, so pages render content only:

import { DataTable, PageHeader, Panel } from '@lincyaw/aegis-ui';

export function ContainerList() {
  return (
    <>
      <PageHeader title="Containers" />
      <Panel>
        <DataTable columns={columns} data={rows} rowKey={(row) => row.id} />
      </Panel>
    </>
  );
}

Documentation

The repository README covers the full contents of the package, the development workflow and the release process. The component gallery shows every component with its variants, in light and dark themes.

版本与发布记录

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

版本发布日期距今
0.7.0latest2026/11/021 天前
0.6.02026/10/295 天前
0.5.02026/10/2113 天前
0.3.02026/05/175 个月前

关于 @lincyaw/aegis-ui 的常见问题

@lincyaw/aegis-ui 是什么?

AegisLab共享设计系统:标记、原语、布局、主题。

如何安装 @lincyaw/aegis-ui?

在项目目录运行 npm install @lincyaw/aegis-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:antd(^5.25.0)、react(^18.0.0)、react-dom(^18.0.0)、react-router-dom(^6.0.0)、@ant-design/icons(^5.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@lincyaw/aegis-ui 支持 TypeScript 吗?

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

@lincyaw/aegis-ui 支持 ESM 还是 CommonJS?

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

@lincyaw/aegis-ui 可以商用吗?

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

@lincyaw/aegis-ui 还在维护吗?

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