@genesislcap/rapid-design-system

中文文档
15.96.2发布于 2026/11/16SEE LICENSE IN license.txtTypeScriptESM + CJS近 30 天下载 3.4万

Rapid Design System

原始使用文档
文档目录10 节
  1. API Docs
  2. Installation
  3. Setting Up the Design System
  4. Providing the Design System & Registering All Components
  5. Registering Specific Components
  6. Registering Third-Party Components
  7. Theming flexlayout-react
  8. Maintaining the theme
  9. License
  10. Licensed components

lerna TypeScript

Genesis Rapid Design System

This package is a Design System (Rapid). It is built on top of the foundation-ui and provides a set of components that are ready to use without any additional configuration.

API Docs

Installation

To enable this module in your application, follow the steps below.

  1. Add @genesislcap/rapid-design-system as a dependency in your package.json file. Whenever you change the dependencies of your project, ensure you run the $ npm run bootstrap command again. You can find more information in the package.json basics page.
{
  "dependencies": {
    "@genesislcap/rapid-design-system'": "latest"
  },
}

Setting Up the Design System

The setup involves providing and registering Design System components from rapid-design-system or other places. Here's how you can do it:

Providing the Design System & Registering All Components

Tipically, in the components.ts file (or your entry-point for app-level setups), you provide the design system using provideDesignSystem and register components against that design system. Here's an example:

import { baseComponents, provideDesignSystem } from '@genesislcap/rapid-design-system';

provideRapidDesignSystem().register(baseComponents);

In the example above, baseComponents is a collection of components that are part of the same Design System. You can also register additional components if needed (even from other Design Systems, which will be prefixed with rapid- in this case).

Registering Specific Components

If you want to register specific components, you can do so by importing them from the design system and registering them. Here's an example:

import { rapidButton, rapidDesignSystemProvider, provideDesignSystem } from '@genesislcap/rapid-design-system';

provideRapidDesignSystem().register(
  /**
   * Design system provider element used to declaratively apply rapid config to every dom node in the host tree.
   */
  rapidDesignSystemProvider(),

  /**
   * Button component
   */
  rapidButton()
);

In the example above, rapid-button will be the only component registered in the Rapid Design System. YOu can also register multiple components at once:

import { provideDesignSystem, rapidButton, rapidCard, rapidDesignSystemProvider, rapidnModal } from '@genesislcap/rapid-design-system';

provideDesignSystem().register(
  /**
   * Design system provider element used to declaratively apply rapid config to every dom node in the host tree.
   */
  rapidDesignSystemProvider(),

  /**
   * Components that will be registered in the Rapid Design System
   */
  rapidButton(),
  rapidCard(),
  rapidModal()
);

Registering Third-Party Components

We provide a few "third-party" components that are not part of the Design System package. These can be registered in the same way as the other Design System components. Here's an example:

import { foundationLayoutComponents } from '@genesislcap/foundation-layout';
import { baseComponents, provideDesignSystem } from '@genesislcap/rapid-design-system';
import { g2plotChartsComponents } from '@genesislcap/g2plot-chart';
import { gridComponents } from '@genesislcap/grid-pro';

provideDesignSystem().register(
  baseComponents,

  /**
   * Third-party components
   */
  foundationLayoutComponents,
  g2plotChartsComponents,
  gridComponents
);

The example above registers Rapid UI components from the Rapid Design System, Foundation Layout, G2Plot Charts, and Grid Pro.

Theming flexlayout-react

flexlayout-react is a third-party docking layout that apps install themselves (it is not bundled into Foundation). The Rapid Design System owns the single source of truth for how it looks, so the theme can never fall out of sync across apps. The platform theme is a self-contained stylesheet — the vendored flexlayout-react base theme plus the rapid token overrides — so apps should never import flexlayout-react's own stylesheets or copy the overrides locally.

Colours resolve from rapid design tokens, so render flexlayout-react under a <rapid-design-system-provider> (CSS custom properties inherit across shadow boundaries).

// Light DOM: install once at app bootstrap (injects into document, idempotent).
import { installRapidFlexLayoutReactStyles } from '@genesislcap/rapid-design-system';

installRapidFlexLayoutReactStyles();
// Shadow DOM: adopt the shared, cached stylesheet into the shadow root that hosts <Layout>.
import { getRapidFlexLayoutReactStyleSheet } from '@genesislcap/rapid-design-system';

shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, getRapidFlexLayoutReactStyleSheet()];

Also exported: rapidFlexLayoutReactStyleText (raw CSS string), rapidFlexLayoutReactStyles (FAST ElementStyles), and RAPID_FLEXLAYOUT_REACT_VERSION (the flexlayout-react version the theme targets — see the optional flexlayout-react peerDependency for the compatible range).

Maintaining the theme

  • Edit the look: change src/flexlayout-react-theme/flexlayout-react.overrides.css, then run pnpm --filter @genesislcap/rapid-design-system flexlayout:generate (the package build does this automatically). The overrides are applied last, so they win over the base theme.
  • Bump flexlayout-react: regenerate the theme in the same change. The build regenerates flexlayout-react-theme.generated.ts from the installed version, so a bump without a regenerate leaves the working tree dirty and fails CI's "Check working tree" gate.

License

Note: this project provides front-end dependencies and uses licensed components listed in the next section; thus, licenses for those components are required during development. Contact Genesis Global for more details.

Licensed components

Genesis low-code platform

版本与发布记录

@genesislcap/rapid-design-system 共发布 2,121 个版本,首次发布于 2023/12/22;过去 12 个月发布了 1023 个版本。

版本发布日期距今
15.96.2latest2026/11/16今天
15.96.12026/11/16今天
15.96.0-GENC-1665.32026/11/142 天前
15.96.02026/11/142 天前
15.95.2-GENC-1665.22026/11/132 天前
15.95.22026/11/133 天前

其他发布通道:pbc-demo → 14.127.6-pbc-demo.4,grid-events → 14.142.1-alpha-2787e5d.0,forms-deepclone → 14.158.1-forms-deepclone.2,genc → 14.162.4-alpha-ea9526e.0,fdc3rowclick → 14.162.1-fdc3rowclick.2,datasrouce-clone-fix → 14.164.1-datasrouce-clone-fix.4。

关于 @genesislcap/rapid-design-system 的常见问题

@genesislcap/rapid-design-system 是什么?

Rapid Design System

如何安装 @genesislcap/rapid-design-system?

在项目目录运行 npm install @genesislcap/rapid-design-system,或使用 pnpm add / yarn add / bun add。

@genesislcap/rapid-design-system 支持 TypeScript 吗?

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

@genesislcap/rapid-design-system 支持 ESM 还是 CommonJS?

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

@genesislcap/rapid-design-system 可以商用吗?

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

@genesislcap/rapid-design-system 的下载量有多少?

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

@genesislcap/rapid-design-system 还在维护吗?

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