@equinor/stratus-ui

中文文档
1.15.0发布于 2026/11/13TypeScriptESM + CJS近 30 天下载 2280

React component library with UI primitives built on Equinor Design System (EDS) tokens. Ships as ESM + CJS with a bundled CSS theme file.

原始使用文档
文档目录8 节
  1. Installation
  2. Peer dependencies
  3. Usage
  4. Development
  5. Project Structure
  6. Component folder layout
  7. Conventions
  8. License

@equinor/stratus-ui

React component library with UI primitives built on Equinor Design System (EDS) tokens. Ships as ESM + CJS with a bundled CSS theme file.

📚 Storybook documentation

Installation

yarn add @equinor/stratus-ui

Peer dependencies

yarn add react react-dom

Usage

Import components and the theme CSS in your app:

import "@equinor/stratus-ui/theme.css";
import { Box } from "@equinor/stratus-ui";

function App() {
  return <Box p={16} gap={8}>Hello Stratus</Box>;
}

Development

yarn install          # Install dependencies
yarn build            # Build library (types + Vite)
yarn test             # Run Vitest tests
yarn lint             # oxlint (fast pass) then ESLint
yarn storybook        # Launch Storybook on port 6006
yarn generate-icons   # Regenerate icon components from @equinor/eds-icons

Project Structure

src/
  index.ts            # Public API — all exports
  components/         # UI components (one folder each)
  icons/              # Generated icon components
  utils/              # Internal utilities (cn, polymorphic, cssProps, etc.)
  theme/              # CSS theme files (EDS tokens mapping)
  styles/             # Global/shared styles

Component folder layout

ComponentName/
  ComponentName.tsx          # Implementation
  ComponentName.css          # Plain CSS with .stratus-* selectors
  ComponentName.stories.tsx  # Storybook story
  __tests__/
    ComponentName.test.tsx   # Vitest tests

Conventions

  • TypeScript everywhere
  • No default exports (icons are the exception — generated code)
  • Plain CSS with .stratus-* prefixed selectors (no CSS Modules, no Tailwind)
  • All public exports go through src/index.ts directly (no per-component barrel files)
  • Components use forwardRefWithAs for polymorphic as prop support
  • CSS variables use --stratus-* namespace
  • Spacing shorthand props (p, m, px, mt, etc.) via CSSProps + extractCSSProps()
  • Class names composed with cn() utility
  • Tests use Vitest + Testing Library + vitest-axe; every component should have an a11y test

License

Private — Equinor internal use only.

版本与发布记录

@equinor/stratus-ui 共发布 29 个版本,首次发布于 2026/06/03;过去 12 个月发布了 29 个版本。

版本发布日期距今
1.15.0latest2026/11/13今天
1.14.52026/11/121 天前
1.14.42026/11/067 天前
1.14.32026/10/2816 天前
1.14.22026/10/2123 天前
1.14.12026/10/141 个月前

关于 @equinor/stratus-ui 的常见问题

@equinor/stratus-ui 是什么?

React component library with UI primitives built on Equinor Design System (EDS) tokens. Ships as ESM + CJS with a bundled CSS theme file.

如何安装 @equinor/stratus-ui?

在项目目录运行 npm install @equinor/stratus-ui,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.0.0 || ^19.0.0)、react-dom(^18.0.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@equinor/stratus-ui 支持 TypeScript 吗?

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

@equinor/stratus-ui 支持 ESM 还是 CommonJS?

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

@equinor/stratus-ui 可以商用吗?

@equinor/stratus-ui 使用 未声明 许可。package.json 没有声明许可证。没有许可证的代码默认保留全部权利,商用前请联系作者或查看仓库中的 LICENSE 文件。以上为概括,不构成法律意见,请以许可原文为准。

@equinor/stratus-ui 的下载量有多少?

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

@equinor/stratus-ui 还在维护吗?

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