@contentstack/venus-components

中文文档
3.0.6发布于 2026/10/12MITTypeScriptESM + CJS近 30 天下载 9374

Venus components

原始使用文档
文档目录10 节
  1. 1. Overview
  2. 2. Tech Stack
  3. 3. Getting Started
  4. Prerequisites
  5. 4. Using the Library in Your Project
  6. Installation for Consumers
  7. Import and Use
  8. Design Tokens
  9. 5. Troubleshooting
  10. Common Issues

Contentstack Venus Component Library


1. Overview

Venus Components is Contentstack's official React component library, providing a comprehensive collection of reusable UI components. It serves as the design system foundation for Contentstack's UI-React application and can be used to build UI Extensions and Contentstack-based applications.

Key Features:

  • 100+ production-ready React components
  • TypeScript support with full type definitions
  • Design token system for consistent theming
  • SCSS-based styling with customizable variables
  • Comprehensive Storybook documentation
  • Accessibility-focused (WCAG AA standards)
  • Redux integration for stateful components
  • Rich Text Editor components (Slate-based)
  • Form components with Formik integration

2. Tech Stack

LayerTechnology
LanguageTypeScript 5.3.3
FrameworkReact 18.3.1
Component LibraryThis is the Venus Components library itself
State ManagementRedux 4.0.5 + React Redux 7.2.1
RouterReact Router DOM 5.2.0
TestingJest 27.5.1 + React Testing Library 10.4.9
Code QualityESLint 8.47.0 + Prettier 2.0.4
Component DocsStorybook 6.5.14
Design TokensStyle Dictionary 2.10.1
StylingSCSS/PostCSS + Design Tokens
FormsFormik 2.4.6
Rich Text EditorSlate 0.77.2
HTTP ClientAxios 1.8.4
Date Handlingdate-fns 2.15.0 + Moment.js 2.29.1

3. Getting Started

Prerequisites

  • Node.js: v18.0.0+ or v24.x
  • npm: v8.19.3+
  • Git: Latest version
  • React: v16.8.6+ || v17 || v18 || v19 (peer dependency)

4. Using the Library in Your Project

Installation for Consumers

$ npm i @contentstack/venus-components --save

Import and Use

import '@contentstack/venus-components/build/main.css'
import { Button, Table, Modal } from '@contentstack/venus-components'

<Button buttonType="primary" onClick={() => console.log('Clicked!')}>Click Me</Button>

Design Tokens

Consumers:

import { TokenName } from '@contentstack/venus-components/build/variables.js'
@import '@contentstack/venus-components/build/variables.css'

5. Troubleshooting

Common Issues

Peer dependency conflicts: Use npm install --legacy-peer-deps or npm install --ignore-scripts --no-engine

Node.js compatibility: Use v18 or v25. Switch with nvm install 22 && nvm use 22

OpenSSL error: Already fixed via NODE_OPTIONS='--openssl-legacy-provider' in package.json

Module errors: Run npm run clean-install

版本与发布记录

@contentstack/venus-components 共发布 23 个版本,首次发布于 2021/10/25;过去 12 个月发布了 4 个版本。

版本发布日期距今
3.0.6latest2026/10/1229 天前
3.0.52026/06/114 个月前
3.0.42026/03/137 个月前
3.0.32026/01/239 个月前
3.0.22025/10/011.1 年前
3.0.12025/09/051.2 年前

关于 @contentstack/venus-components 的常见问题

@contentstack/venus-components 是什么?

Venus components

如何安装 @contentstack/venus-components?

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

@contentstack/venus-components 支持 TypeScript 吗?

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

@contentstack/venus-components 支持 ESM 还是 CommonJS?

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

@contentstack/venus-components 需要什么版本的 Node.js?

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

@contentstack/venus-components 可以商用吗?

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

@contentstack/venus-components 的下载量有多少?

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

@contentstack/venus-components 还在维护吗?

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