@db-ui/base

中文文档
0.29.4发布于 2025/11/09Apache-2.0CommonJS零依赖构建来源已验证近 30 天下载 4524

Provides basic tokens and assets based on the DB Design System.

原始使用文档
文档目录7 节
  1. Deutsche Bahn brand
  2. How to consume
  3. General npm context
  4. How it works / to contribute
  5. Third party acknowledgments – many kudos for that !!!
  6. Code of conduct
  7. License

DB UI Base

REUSE status REUSE Compliance Check Creates copyright & license annotations with REUSE

[!IMPORTANT] We've released the new stable version of the DB UX Design System v3, which is the successor to this generation of DB Design Systems. Especially for new projects, we strongly recommend building on DB UX Design System v3. The new version has some great benefits and optimisations, especially in terms of accessibility testing, further and better framework support and ongoing development.

Please note that we won't be providing any new features from now on, only bug fixes until EOL at the end of 2026.

With DB UI Base we provide you with basic Design Tokens and assets based on the DB UX Design System v2, that can be shared across web and native apps projects.

For more information, have a look at our hosted patternlab.

Deutsche Bahn brand

As we'd like to perfectly support our users and customers on their digital journey, the usage of Deutsche Bahn brand and trademarks are bound to clear guidelines and restrictions even when being used with the code that we're providing with this product; Deutsche Bahn fully reserves all rights and ownership regarding the Deutsche Bahn brand, even though that we're providing the code of DB UI products free to use and release it under the Apache 2.0 license. Please have a look at our brand portal for any further questions and whom to contact on any brand issues. As these assets and visual guidelines are retrieved from our Deutsche Bahn Marketingportal, you'll agree with the "Allgemeine Nutzungsbedingungen für das DB-Marketingportal" (german) in case of using them.

For any usage outside of Deutsche Bahn websites and applications you must remove or replace any Deutsche Bahn brand and design assets as well as protected characteristics and trademarks. We're even also planning to provide a neutral theme that would make it much easier for you to use our product without the trademarks by Deutsche Bahn.

This especially relates to the files in the directories /assets/ and source/images and source/favicon.ico as well.

How to consume

General npm context

Install DB UI Base like this:

npm i -save @db-ui/base

Tailwind

Install Tailwind based on your framework: Installations, but don't use npx tailwindcss init.

Instead, run this command in your project:

node ./node_modules/@db-ui/base/build/tailwind/tailwind-config-generator.mjs

This will create your tailwind.config.js.


If you don't want to have a customizable config, you can also use the default tailwind-config by running:

node ./node_modules/@db-ui/base/build/tailwind/tailwind-config-generator.mjs default

The config contains all colors, fonts and spacings. Make sure to check the official guidelines for spacings (1 unit === 16px).

How it works / to contribute

Contributions are very welcome, please refer to the contribution guide.

All of the style tokens and assets are in this package. Make any changes to suit your needs. This package has iOS, Android, and web code, and is based on Amazon Style Dictionary Complete Example.

To get started, run

npm install
npm run build

The npm build task is what performs the style dictionary build steps to generate the files for each platform. Every time you change something in the style dictionary, like changing colors or adding tokens, you will have to run this command again to generate the files.

Third party acknowledgments – many kudos for that !!!

Code of conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone – have a look at our Contributor Covenant Code of Conduct.

License

The DB source code is licensed under the Apache License, Version 2.0, January 2004; you may not use this file except in compliance with the License. You may obtain a copy of the Apache License at https://apache.org/licenses/LICENSE-2.0. The DB source code does not include any DB specific design assets like fonts, icons, trademarks, brandings, etc.

Apache 2.0 license

All Deutsche Bahn AG (hereinafter “DB”) specific design assets like fonts, icons, trademarks, brandings, etc. (hereinafter “DB Designs”) are licensed under the following license agreement (the “DB Designs License”):

DB Designs License

版本与发布记录

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

版本发布日期距今
0.29.4latest2025/11/091 年前
0.29.32025/11/091 年前
0.29.3-3-bbbf9e6next2025/11/091 年前
0.29.22025/03/181.7 年前
0.29.12025/03/131.7 年前
0.29.02024/12/141.9 年前

其他发布通道:dbux-3 → 2.0.0-22-d2b94f4,next → 0.29.3-3-bbbf9e6。

关于 @db-ui/base 的常见问题

@db-ui/base 是什么?

Provides basic tokens and assets based on the DB Design System.

如何安装 @db-ui/base?

在项目目录运行 npm install @db-ui/base,或使用 pnpm add / yarn add / bun add。

@db-ui/base 支持 TypeScript 吗?

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

@db-ui/base 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@db-ui/base 可以商用吗?

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

@db-ui/base 的下载量有多少?

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

@db-ui/base 还在维护吗?

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