@dagster-io/ui-components

中文文档
1.4.1发布于 2026/02/19Apache-2.0TypeScriptESM + CJS近 30 天下载 2114

Dagster UI Component Library

原始使用文档
文档目录6 节
  1. Dagster UI Component Library
  2. Usage
  3. 1. Install package.
  4. 2. Add font styles
  5. 3. Import components
  6. 4. Add Blueprint CSS.

Dagster UI Component Library

This project contains the core React UI component library used by Dagster products.

While published as a public package, it is not intended for use outside Dagster code, and is not currently supported for public consumption.

Semver usage is likely to be inconsistent, and new versions may be published with breaking changes without warning.

Usage

1. Install package.

yarn add @dagster-io/ui-components

Note that the library currently includes a lot of peer dependencies. Be sure to install these.

2. Add font styles

If necessary, add font styles to your application root and use them in your global styles.

If you are importing fonts via some other means (e.g. Google Fonts API) you may not need to do this.

import {FontFamily, GlobalInter} from '@dagster-io/ui-components`;
import {createGlobalStyle} from 'styled-components';

const GlobalStyle = createGlobalStyle`
  * {
    font-family: ${FontFamily.default}; /* Default font is Inter */
  }
`;

const MyAppRoot = () => (
  <>
    <GlobalInter />
    <GlobalStyle />
    <div>
      /* Your app */
    </div>
  </>
);

3. Import components

import {Box, Button, Color, Icon} from '@dagster-io/ui-components';

The rollup build specifies certain common components to be split into their own bundles to allow consumers to minimize their bundle size and avoid importing the entire library, since it currently contains a lot of complex, heavy components that you may not need.

If you find that your import of a specific component has blown up your build size, we can add it to the input list in rollup.config.js to split it into its own bundle.

4. Add Blueprint CSS.

If necessary, add Blueprint CSS. Some components require underlying Blueprint styles. Many do not.

How do I know if I need Blueprint?

  • Check if the component you are using renders a Blueprint component. If so, include Blueprint CSS.
  • If you're not sure, try rendering the component and see if its styles look broken. If so, and the styles involve a bp3 CSS class, you need Blueprint CSS.
/* blueprint.css */

@import '@blueprintjs/core/lib/css/blueprint.css';
@import '@blueprintjs/icons/lib/css/blueprint-icons.css';
@import '@blueprintjs/select/lib/css/blueprint-select.css';
@import '@blueprintjs/table/lib/css/table.css';
@import '@blueprintjs/popover2/lib/css/blueprint-popover2.css';
import './blueprint.css';

export const MyAppRoot = () => ...;

版本与发布记录

@dagster-io/ui-components 共发布 10 个版本,首次发布于 2023/08/03;过去 12 个月发布了 2 个版本。

版本发布日期距今
1.4.1latest2026/02/198 个月前
1.4.02025/12/2410 个月前
1.3.02025/10/291 年前
1.2.12024/12/101.9 年前
1.2.02024/12/061.9 年前
1.1.42024/10/122 年前

关于 @dagster-io/ui-components 的常见问题

@dagster-io/ui-components 是什么?

Dagster UI Component Library

如何安装 @dagster-io/ui-components?

在项目目录运行 npm install @dagster-io/ui-components,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@blueprintjs/core(^5)、@blueprintjs/popover2(^2)、@blueprintjs/select(^5)、@tanstack/react-virtual(^3.0.1)、react(^18.3.1)、react-dom(^18.3.1)、react-is(^18.3.1)、styled-components(^5.3.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@dagster-io/ui-components 支持 TypeScript 吗?

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

@dagster-io/ui-components 支持 ESM 还是 CommonJS?

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

@dagster-io/ui-components 可以商用吗?

@dagster-io/ui-components 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@dagster-io/ui-components 的下载量有多少?

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

@dagster-io/ui-components 还在维护吗?

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