@cratis/components.primereact10

中文文档
4.40.0发布于 2026/11/04MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 4031

PrimeReact 10 presentation adapter for Cratis Components renderer ABI v1.

原始使用文档
文档目录3 节
  1. Install
  2. Theme and global configuration
  3. SSR and package boundaries

@cratis/components.primereact10

PrimeReact 10 adapter for the nine stable presentation slots in the Cratis Components renderer ABI v1. The package shares the Components repository release version while the renderer ABI remains versioned separately. It exports one stable CratisPresentationUiLibrary manifest, primeReact10UiLibrary. This certifies nine-slot primitive adaptation, never full-catalog replacement.

PrimeReact 11 uses a different package architecture and license boundary. It is supported separately by @cratis/components.primereact; the two adapters must use isolated upstream dependency graphs.

Versions: each release of @cratis/components.primereact10 is published at the same version as @cratis/components and declares a peer on exactly that version. Install and upgrade the two packages together at the same version.

Install

npm install @cratis/components.primereact10@^4 @cratis/components@^4 \
  primereact@^10.9.9 react@^19 react-dom@^19

Node-based build, test, and server-rendering environments require Node.js 22 or newer.

The adapter covers Button, IconButton, TextInput, TextArea, Checkbox, Radio, Switch, ProgressBar, and Surface. The five atomic interaction slots are not part of this profile and continue through the Components built-in fallback.

PrimeReact 10 is MIT licensed and requires no PrimeUI key or Components renderer setup attestation. Version 10.9.9 is the minimum supported upstream because it fixes the prototype-pollution advisory that affects PrimeReact releases through 10.9.8.

Theme and global configuration

PrimeReact 10 styled components require one application-selected theme stylesheet. Import it once in the application entry point before application overrides:

import 'primereact/resources/themes/lara-light-cyan/theme.css';

The distributed theme is precompiled CSS and does not require Sass. Sass is needed only when an application chooses to compile a custom PrimeReact 10 theme. PrimeIcons is optional; install and import primeicons/primeicons.css only if the application uses PrimeIcons directly.

An outer PrimeReactProvider is optional. The adapter creates a default provider only when the application has not supplied one. An application can own global PrimeReact 10 options such as ripple, locale, CSP nonce, style container, pass-through defaults, or z-index configuration:

import { PrimeReactProvider } from 'primereact/api';
import { CratisComponentsProvider } from '@cratis/components';
import { primeReact10UiLibrary } from '@cratis/components.primereact10';

export const Application = () => (
    <PrimeReactProvider value={{ ripple: true }}>
        <CratisComponentsProvider
            value={{ locale: 'en-US' }}
            library={primeReact10UiLibrary}
        >
            <main>Application content</main>
        </CratisComponentsProvider>
    </PrimeReactProvider>
);

Components that execute commands or run queries also need Arc's <Arc> provider from @cratis/arc.react around this tree; neither the adapter nor CratisComponentsProvider replaces it.

The application owns theme imports and any outer provider configuration. Components does not configure an application's direct PrimeReact usage.

SSR and package boundaries

All nine slots are required to produce deterministic static markup, and the representative Button fixture must hydrate without a mismatch. PrimeReact 10 predates modern package export maps, so the adapter's packed runtime gate verifies the exact legacy module interop used by the published build. Hosts remain responsible for loading global theme CSS in the framework-prescribed location and for CSP or style-container configuration.

PrimeReact is a bounded peer and is never bundled. The exact repository proof uses PrimeReact 10.9.9 and React 19. PrimeReact 10 and 11 cannot satisfy one another's peer range and must not share one Storybook preview or application dependency resolution.

The source manifest declares @cratis/components >=4 <5, the Components major whose renderer ABI and stable presentation profile the adapter implements. The release step replaces that range with the exact release version, so a published adapter requires the @cratis/components release it shipped with.

See CONFORMANCE.md for bounded evidence and THIRD_PARTY_NOTICES.md for upstream licensing.

版本与发布记录

@cratis/components.primereact10 共发布 83 个版本,首次发布于 2026/08/31;过去 12 个月发布了 83 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
4.40.0latest2026/11/046 天前
4.39.52026/11/046 天前
4.39.42026/11/047 天前
4.39.32026/11/037 天前
4.39.22026/11/037 天前
4.39.12026/11/037 天前

其他发布通道:bootstrap → 0.0.0。

关于 @cratis/components.primereact10 的常见问题

@cratis/components.primereact10 是什么?

PrimeReact 10 presentation adapter for Cratis Components renderer ABI v1.

如何安装 @cratis/components.primereact10?

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

@cratis/components.primereact10 支持 TypeScript 吗?

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

@cratis/components.primereact10 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@cratis/components.primereact10 需要什么版本的 Node.js?

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

@cratis/components.primereact10 可以商用吗?

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

@cratis/components.primereact10 的下载量有多少?

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

@cratis/components.primereact10 还在维护吗?

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