@databricks/design-system

中文文档
2.0.16发布于 2026/11/03ISCTypeScriptESM + CJS近 30 天下载 7434

dbui Design System

原始使用文档
文档目录5 节
  1. Start a project with dbui
  2. Share a mockup (Databricks employees)
  3. Copy a page template
  4. Feature flags
  5. Using dbui with a coding agent

dbui Design System

Component library for Databricks.

Start a project with dbui

Run npx @databricks/design-system to create a Vite or Next.js project, or to add the design system to an existing React project. The tool installs the package and required peers, configures Emotion and global styles, and adds coding-agent guidance.

New projects include a floating theme picker for the original Du Bois theme (default), dbui Base, Genie One, and a shadcn neutral approximation. All fonts and light/dark settings are included; theme and appearance choices persist in the browser. For scripted runs, set the initial theme with --theme dubois, --theme base, --theme genie-one, or --theme shadcn.

Share a mockup (Databricks employees)

From a Vite project created above, run npx @databricks/design-system share to upload it to SP2K Design, Databricks' internal mockup gallery, and get a review link to share:

npx @databricks/design-system share --project "Onboarding redesign" --artifact "Intent modal" --note "First pass"

Rerun with the same --project and --artifact to add a version; --invite email[:role] grants reviewers access. It needs the Databricks CLI signed in to E2 dogfood (databricks auth login --host https://e2-dogfood.staging.cloud.databricks.com --profile e2-dogfood). Run it with --help for every option.

Copy a page template

The package includes editable dbui page templates inspired by the shadcn/ui blocks gallery. From a React project set up with dbui, run:

npx @databricks/design-system page-templates
npx @databricks/design-system add LandingPage

add copies the bundled source into src/page-templates/ without replacing existing files. Each template also installs PageTemplateMain.tsx, workspace-shell.tsx, and workspace-shell-top-bar.tsx. Unchanged shared helpers are reused on subsequent installs. The package includes 12 page layouts; run page-templates to list their PascalCase names. Wire the copied template into your app and supply content through its slots. See docs/agents-npm/common/page-templates.md for the catalog and usage guidance.

Feature flags

Some dbui components switch between implementations based on a feature flag, such as databricks.fe.designsystem.useNativeButton. By default, each flag uses the value this package was published with. You can override flags by calling setDesignSystemFlags before your app first renders:

import { setDesignSystemFlags } from '@databricks/design-system/flags';

setDesignSystemFlags({
  'databricks.fe.designsystem.useNativeButton': false,
});

createRoot(document.getElementById('root')!).render(<App />);

Each call replaces the overrides from the previous call. dbui ignores an override whose type doesn't match the flag, e.g. a number for a boolean flag.

Note that components read flags while they render and don't re-render when flags change, so set flags before the first render.

Using dbui with a coding agent

This package ships AGENTS.md, which links to its guidance on setup, component selection, theming, accessibility, and the pitfalls to avoid. You can include @node_modules/@databricks/design-system/AGENTS.md in your project's agent instructions. The agent guidance also links to copyable page templates.

版本与发布记录

@databricks/design-system 共发布 70 个版本,首次发布于 2021/11/12;过去 12 个月发布了 17 个版本。

版本发布日期距今
2.0.16latest2026/11/038 天前
2.0.152026/10/1626 天前
2.0.142026/10/031 个月前
2.0.132026/10/011 个月前
2.0.122026/09/261 个月前
2.0.112026/09/241 个月前

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

@databricks/design-system 是什么?

dbui Design System

如何安装 @databricks/design-system?

在项目目录运行 npm install @databricks/design-system,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(*)、moment(^2.25.3)、react-dom(*)、@jest/globals(^30.0.2)、@emotion/react(^11.11.3)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 dbui-mcp、design-system,可以用 npx dbui-mcp 直接运行。

@databricks/design-system 支持 TypeScript 吗?

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

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

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

@databricks/design-system 可以商用吗?

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

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

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

@databricks/design-system 还在维护吗?

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