@bpmn-io/shadcn-theme

中文文档
0.0.1发布于 2026/08/21MIT零依赖近 30 天下载 1.8万

A shadcn theme for bpmn.io

原始使用文档
文档目录4 节
  1. Usage
  2. Camunda Design System (C4) override
  3. Build and Run
  4. License

bpmn.io Shadcn Theme

CI

A portable shadcn/ui theme for bpmn.io, with an optional Camunda Design System (C4) override.

Usage

Apply bpmn-io-shadcn-theme to a common ancestor, load the base component CSS, then the shared tokens and the adapter for each component in use:

<div class="bpmn-io-shadcn-theme">
  <div id="canvas"></div>
  <div id="properties-panel"></div>
</div>
import '@bpmn-io/properties-panel/dist/assets/properties-panel.css';
import '@bpmn-io/shadcn-theme/assets/tokens.css';
import '@bpmn-io/shadcn-theme/assets/properties-panel.css';

Each adapter loads after the base CSS of the component it themes. To also theme the diagram surfaces — the palette, the search pad and the popup editor (the create, append and replace menus) — load diagram.css after the bpmn-js stylesheets:

import 'bpmn-js/dist/assets/diagram-js.css';
import 'bpmn-js/dist/assets/bpmn-js.css';
import '@bpmn-io/shadcn-theme/assets/tokens.css';
import '@bpmn-io/shadcn-theme/assets/diagram.css';

Add dark to the theme root (or any ancestor) for dark mode, and override the --shadcn-* properties to match your shadcn configuration:

.bpmn-io-shadcn-theme {
  --shadcn-primary: 221.2 83.2% 53.3%;
  --shadcn-radius: 0.75rem;
}

Camunda Design System (C4) override

C4 exposes its own scoped semantic tokens. Render inside C4Provider and import c4.css after the adapter; it only applies beneath .c4-ui, leaving stock shadcn consumers unaffected:

import '@camunda/design-system/styles.css';
import '@bpmn-io/shadcn-theme/assets/tokens.css';
import '@bpmn-io/shadcn-theme/assets/properties-panel.css';
import '@bpmn-io/shadcn-theme/assets/diagram.css';
import '@bpmn-io/shadcn-theme/assets/c4.css';

Build and Run

Prepare the project by installing all dependencies:

npm install

Then, depending on your use-case, you may run any of the following commands:

# lint and run all tests
npm run all

# run all tests
npm test

# spin up the canonical playground to try the theme end-to-end
npm start

# capture side-by-side theme comparison screenshots into .captures/
npm run capture

To explore a narrower surface, it.only a scenario spec or spin up one of the component-specific playgrounds:

npm run start:properties-panel
npm run start:diagram
npm run start:bpmn
npm run start:element-template-chooser

License

MIT

版本与发布记录

@bpmn-io/shadcn-theme 共发布 1 个版本,首次发布于 2026/08/21;过去 12 个月发布了 1 个版本。

版本发布日期距今
0.0.1latest2026/08/212 个月前

关于 @bpmn-io/shadcn-theme 的常见问题

@bpmn-io/shadcn-theme 是什么?

A shadcn theme for bpmn.io

如何安装 @bpmn-io/shadcn-theme?

在项目目录运行 npm install @bpmn-io/shadcn-theme,或使用 pnpm add / yarn add / bun add。

@bpmn-io/shadcn-theme 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/bpmn-io__shadcn-theme 是否存在。

@bpmn-io/shadcn-theme 可以商用吗?

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

@bpmn-io/shadcn-theme 的下载量有多少?

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

@bpmn-io/shadcn-theme 还在维护吗?

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