@engie-group/fluid-design-system

中文文档
6.4.0发布于 2026/09/09EPL-2.0TypeScriptESM + CJS近 30 天下载 7564

The Fluid Design System is ENGIE’s open-source library to create, build and deliver ENGIE digital services in a more efficient way.

此软件包已被标记为弃用

Deprecated and no longer maintained. Migrate to @engie-group/fluid-design-system-webcomponents

原始使用文档
文档目录8 节
  1. Deprecation notice
  2. Why this change?
  3. Versioning
  4. Getting started
  5. NPM installation
  6. CDN installation
  7. Documentation and usage
  8. Troubleshooting and feature requests

Fluid Design System Vanilla JS

Fluid is the Engie's design system, a collection of reusable components and styles used to build Engie's digital products.

Here is the package to benefit from Fluid's components and styles in your typescript project.

Deprecation notice

@engie-group/fluid-design-system is deprecated. The release containing this notice is the final release of the Vanilla JS library. No new features, bug fixes, security updates, or releases will be provided afterward.

Migrate to @engie-group/fluid-design-system-webcomponents, the supported successor. It is not a drop-in replacement: consult the Web Components documentation for the markup and API of each component.

npm install @engie-group/fluid-design-system-webcomponents @engie-group/fluid-design-tokens

Why this change?

  • Increased interoperability: Web Components are natively compatible with all modern frameworks (React, Angular, Vue, etc.) and can be used without any framework.
  • Simplified maintenance: A single codebase for all environments, reducing technical debt and making future evolutions easier.
  • Standardization: Adoption of web standards ensures better sustainability and scalability.

For migration support, consult the Web Components documentation or contact the Fluid team.

Versioning

⚠️ This package doesn't follow semantic versioning, breaking changes are introduced in minor versions.

Versions are structured as GLOBAL.BREAKING.MINOR where:

  • GLOBAL is the global version of Fluid Design System (ex: Fluid 4, Fluid 5, Fluid 6 etc.). We are currently at Fluid 6.
  • BREAKING is incremented for each breaking-change (component API change, layout change, etc.).
  • MINOR is incremented for bug fixes, features and non-breaking changes.

We recommend using ~ semver range to avoid breaking changes affecting your application. Moreover, we recommend checking the CHANGELOG before updating the package after a release.

Getting started

This package can be installed directly with NPM or via CDN.

NPM installation

You can install the package inside your application via npmjs:

# Using npm
npm install @engie-group/fluid-design-system @engie-group/fluid-design-tokens

# Using pnpm
pnpm add @engie-group/fluid-design-system @engie-group/fluid-design-tokens

# Using yarn
yarn add @engie-group/fluid-design-system @engie-group/fluid-design-tokens

CSS

Component styling is based on CSS classes and some CSS variables (called design tokens). In order for each component to be rendered as expected, you need to include CSS files as global stylesheet in your project.

You should include them in your HTML <head>:

<!-- tokens.css = Styles to import tokens needed by components -->
<link
  href="<your-relative-path-to-node_modules>/@engie-group/fluid-design-tokens/lib/css/tokens.css"
  rel="stylesheet"
/>
<!-- fluid-design-system.css = Styles of all components -->
<link
  href="<your-relative-path-to-node_modules>/@engie-group/fluid-design-system/lib/fluid-design-system.css"
  rel="stylesheet"
/>

or in your JavaScript entry file :

import '@engie-group/fluid-design-tokens/css';
import '@engie-group/fluid-design-system/css';

or in your CSS entry file :

@import '@engie-group/fluid-design-tokens/css';
@import '@engie-group/fluid-design-system/css';

ℹ️ We recommend including the Fluid Design System CSS before your own stylesheets to avoid any conflicts.

Javascript

Some components need JavaScript code to work properly.

When your DOM is rendered, dynamic components will need to be initialized to work properly.

To do so, you will have to initialize them either with a global script which will initialize all components or by initializing each component individually.

Global initialization

You can use the auto initializer script to initialize all components at once.

Add the following script near the end of your pages, right before the closing </body> tag:

<script
  type="module"
  src="<your-relative-path-to-node_modules>/@engie-group/fluid-design-system/lib/auto-init.js"
></script>
Individual initialization

You can also initialize each component individually in your JavaScript by calling the static init method of the component.

For example, to initialize all Select components on your page, you can use the following code:

// In a JS file or script tag called right before the end of the body
import { Select } from '@engie-group/fluid-design-system';

Select.init();

CDN installation

It's possible to use Fluid Design System via CDN. This is the recommended way to use Fluid if you don't have a build process or if you want to quickly test Fluid in a project.

As with the NPM installation, you will need to include some CSS and JavaScript files in your project. Installations are very similar.

CSS

Component styling is based on CSS classes and some CSS variables (called design tokens). In order for each component to be rendered as expected, you need to include CSS files as global stylesheet in your project.

You should include them in your HTML <head>:

<!-- tokens.css = Styles to import tokens needed by components -->
<link
  href="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-tokens@<VERSION>/lib/css/tokens.css"
  rel="stylesheet"
/>
<!-- fluid-design-system.css = Styles of all components -->
<link
  href="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@<VERSION>/lib/fluid-design-system.css"
  rel="stylesheet"
/>

ℹ️ We recommend including the Fluid Design System CSS before your own stylesheets to avoid any conflicts.

Javascript

Some components need JavaScript code to work properly.

To access components in your code we export a global NJ constant that contains all components. To make it available, you will have to set this script before using any component:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@<VERSION>/lib/fluid-design-system.js"
></script>

When your DOM is rendered, dynamic components will need to be initialized to work properly.

To do so, you will have to initialize them either with a global script which will initialize all components or by initializing each component individually.

Global initialization

You can use the auto initializer script to initialize all components at once.

Add the following script near the end of your pages, right before the closing </body> tag:

<script
  type="module"
  src="https://cdn.jsdelivr.net/npm/@engie-group/fluid-design-system@<VERSION>/lib/auto-init.js"
></script>
Individual initialization

You can also initialize each component individually in your JavaScript by calling the static init method of the component.

For example, to initialize all Select components on your page, you can use the following code:

// In a JS file or script tag called right before the end of the body
NJ.Select.init();

Documentation and usage

For a better comprehension of the components and their usage, we recommend checking our Storybook documentation.

For Fluid overall documentation, you can check our Fluid documentation.

If you have correctly followed the installation steps, you should be able to use Fluid components in your project.

<body>
  <!-- basic Fluid button component -->
  <button type="button" class="nj-btn">Fluid button</button>

  <!-- basic Fluid select component -->
  <div class="nj-form-item nj-form-item--select">
    <div class="nj-form-item__field-wrapper">
      <select class="nj-form-item__field" id="exampleSelect">
        <optgroup label="Group 1">
          <option>Item 1</option>
          <option>Item 2</option>
        </optgroup>
        <optgroup label="Group 2">
          <option>Item 3</option>
          <option>Item 4</option>
          <option>Item 5</option>
        </optgroup>
      </select>
      <label for="exampleSelect" class="nj-form-item__label">Example</label>
      <div class="nj-form-item__trailing">
        <span aria-hidden="true" class="nj-form-item__icon material-icons">keyboard_arrow_down</span>
      </div>
    </div>
  </div>
  <script
    type="module"
    src="<your-relative-path-to-node_modules>/@engie-group/fluid-design-system/lib/auto-init.js"
  ></script>
</body>

Troubleshooting and feature requests

If you encounter any issues, or you want any component or feature to be implemented, please create an issue or a feature request on our GitHub repository.

版本与发布记录

@engie-group/fluid-design-system 共发布 116 个版本,首次发布于 2019/11/21;过去 12 个月发布了 10 个版本。

版本发布日期距今
6.4.0latest2026/09/092 个月前
6.3.02026/08/123 个月前
6.2.02026/05/116 个月前
6.1.22026/04/306 个月前
6.1.12026/04/296 个月前
6.1.02026/04/017 个月前

其他发布通道:alpha → 5.0.0-alpha.5,beta → 5.0.0-beta.1,next → 6.0.0-next.11,rc → 6.0.0-rc.0。

关于 @engie-group/fluid-design-system 的常见问题

@engie-group/fluid-design-system 是什么?

The Fluid Design System is ENGIE’s open-source library to create, build and deliver ENGIE digital services in a more efficient way.注意:该包已被作者标记为弃用——Deprecated and no longer maintained. Migrate to @engie-group/fluid-design-system-webcomponents

如何安装 @engie-group/fluid-design-system?

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

@engie-group/fluid-design-system 支持 TypeScript 吗?

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

@engie-group/fluid-design-system 支持 ESM 还是 CommonJS?

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

@engie-group/fluid-design-system 可以商用吗?

@engie-group/fluid-design-system 使用 EPL-2.0 许可。声明的许可为 EPL-2.0,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@engie-group/fluid-design-system 的下载量有多少?

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

@engie-group/fluid-design-system 还在维护吗?

最新版本 6.4.0 发布于 2026/09/09(2 个月前);至今共发布 116 个版本,其中过去 12 个月发布了 10 个;首次发布于 2019/11/21。作者已将其标记为弃用,新项目建议寻找替代方案。