@getpara/react-component-library

中文文档
3.28.0发布于 2026/11/13TypeScriptES Module近 30 天下载 6443

Built using shadcn/ui

原始使用文档
文档目录3 节
  1. Adding Components
  2. Extending base Tailwind styles in other internal projects
  3. Using Tailwind Intellisense

Para Component Library

Built using shadcn/ui

Adding Components

Given our monorepo setup, adding new base components from shadcn if they require additional dependency installations can't be done with the CLI tool.

To install components that DO NOT require additional dependency installation do the following:

  1. run npx shadcn@canary add [COMPONENT]

To install components that require additional dependency installation do the following:

  1. Find the component you're looking to add here
  • NOTE Don't use the current shadcn docs until they are upgraded to the canary branch. We are using this release to take advantage of v4 of Tailwind.
  1. Copy the entire component file into the src/components/base directory. It's recommended to use the same naming convention that shadcn uses here.
  2. Append all existing classname strings with APPLY_PARA_PREFIX & run node ./scripts/applyParaPrefix.mjs to append para: to all classnames.
  • NOTE In addition to this prefix application, look out for Tailwind theme vars that will need para appended. The most prevalent example of this is the --spacing var, this would need to be updated to --para-spacing. If things aren't looking right in Storybook for new components this is something that should be checked.
  1. Install any dependencies the component requires. The correct versions can be found here
  2. Export the component from src/components/base/index.ts

Extending base Tailwind styles in other internal projects

Our base tailwind css is exported from the component library as theme.css. In order for these styles to be available in other internal projects the following should be added to the root css file (see the example in index.css in the developer-portal site):

@import '@getpara/react-component-library/styles.css';
@import '@getpara/react-component-library/theme.css';
@import 'tailwindcss' prefix(para);

This will both import the styles in css and add the source for Tailwind v4 as the internal styles from the component library in order for intellisense to work properly.

NOTE All our Tailwind styles from the component library are prefixed with para: to avoid any style collisions with existing Tailwind implementations.

Using Tailwind Intellisense

Since we are using a monorepo, we need to manually adjust some things for Tailwind Intellisense for Tailwind v4 to work properly. The following should be added to your .vscode/settings.json file in order to ensure Tailwind Intellisense works properly.

  "tailwindCSS.experimental.configFile": {
    "packages/component-lib/src/global.css": "packages/component-lib/src/**",
    "sites/developer-portal/src/index.css": "sites/developer-portal/src/**"
  },
  "files.associations": {
    "*.css": "tailwindcss"
  }

版本与发布记录

@getpara/react-component-library 共发布 32 个版本,首次发布于 2026/04/25;过去 12 个月发布了 32 个版本。

版本发布日期距今
3.28.0latest2026/11/133 天前
3.27.02026/11/106 天前
3.26.02026/11/0610 天前
3.25.02026/10/3017 天前
3.24.02026/10/2324 天前
3.23.02026/10/161 个月前

其他发布通道:alpha → 3.0.0-alpha.1。

关于 @getpara/react-component-library 的常见问题

@getpara/react-component-library 是什么?

Built using shadcn/ui

如何安装 @getpara/react-component-library?

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

@getpara/react-component-library 支持 TypeScript 吗?

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

@getpara/react-component-library 支持 ESM 还是 CommonJS?

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

@getpara/react-component-library 可以商用吗?

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

@getpara/react-component-library 的下载量有多少?

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

@getpara/react-component-library 还在维护吗?

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