@oods/components-react

中文文档
0.11.3发布于 2026/11/02Apache-2.0TypeScriptESM + CJS

React components for OODS Foundry: the controls, layouts and domain views its generated screens use.

原始使用文档
文档目录4 节
  1. Install
  2. First result
  3. Limits
  4. License

@oods/components-react

React components used by screens generated with OODS Foundry. The package exports controls, layouts and domain views; @oods/component-styles provides their CSS.

Install

npm install @oods/components-react @oods/component-styles @oods/tokens @oods/component-contracts react react-dom

Use React and React DOM 18 or 19. Bring your existing React app or use OODS Foundry's code_generate with options.output: "application" for an app entry and Vite configuration.

First result

import { Button } from '@oods/components-react';
import '@oods/component-styles/css';

export function App() {
  return <Button content="Review stock" intent="primary"
    onActivate={() => window.alert('Connect this action to your application.')} />;
}

Set data-brand="A" and data-theme="light" on the root HTML element. The result is a button labelled “Review stock” that invokes the supplied handler. Set the theme to dark or hc for those scopes.

Generated sample screens identify their sample data. A workflow's local store is not a production database; supply your data, navigation and persistence handlers. Retained component evidence covers named scenarios and themes, not every application you build. For your own implementation of a shipped component, use OODS Foundry's substitution mapping and inspect its advisory contract report.

Limits

Generated apps pin the OODS release that generated them; to upgrade, regenerate the app or move all four pins together. These packages are separate from the local MCP server, @oods/foundry.

License

Apache License 2.0. See LICENSE and NOTICE. Generated output belongs to its user; installed package dependencies retain their own licenses.

版本与发布记录

@oods/components-react 共发布 25 个版本,首次发布于 2026/09/26;过去 12 个月发布了 25 个版本。

版本发布日期距今
0.11.3latest2026/11/021 天前
0.11.22026/10/1123 天前
0.11.12026/10/1023 天前
0.11.02026/10/0925 天前
0.10.22026/10/0925 天前
0.10.12026/10/0825 天前

关于 @oods/components-react 的常见问题

@oods/components-react 是什么?

用于OODS Foundry的React组件:它生成的屏幕使用的控件、布局和域视图。

如何安装 @oods/components-react?

在项目目录运行 npm install @oods/components-react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(>=18 <20)、react-dom(>=18 <20)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@oods/components-react 支持 TypeScript 吗?

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

@oods/components-react 支持 ESM 还是 CommonJS?

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

@oods/components-react 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@oods/components-react 可以商用吗?

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

@oods/components-react 还在维护吗?

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