@bigbluebutton/bbb-ui-components-react

中文文档
0.10.0发布于 2026/10/27LGPL-3.0TypeScriptESM + CJS构建来源已验证近 30 天下载 2010

This repository contains a library of reusable React components extracted from the main BigBlueButton (BBB) project. These components provide a consistent and customizable interface that can be reused

原始使用文档
文档目录9 节
  1. Available Components
  2. Peer Dependencies
  3. Color Customization with CSS Variables
  4. Available CSS Variables
  5. Importing Color Tokens in JS
  6. Installation
  7. Local Development
  8. Building the bundle
  9. Using npm link

BBB UI Components React

This repository contains a library of reusable React components extracted from the main BigBlueButton (BBB) project. These components provide a consistent and customizable interface that can be reused in other projects, allowing them to easily adopt the BBB visual identity.

Available Components

Below is a list of the components available in this library. Each component has its own detailed documentation with usage examples and a complete list of props.

Peer Dependencies

This library requires the following peer dependencies to be installed in your project:

react ^18.2.0
react-dom ^18.2.0
styled-components >=5.3.0
react-modal >=3.16.1
@emotion/react ^11.13.0
@emotion/styled ^11.13.0
@mui/material ^6.4.9 || ^7.0.0
@mui/icons-material ^6.4.9 || ^7.0.0
prop-types ^15.8.1
react-icons ^5.5.0

Make sure to install these dependencies to avoid runtime errors and ensure compatibility.

You can install all of them with the following command:

npm install react react-dom styled-components react-modal @emotion/react @emotion/styled @mui/material @mui/icons-material prop-types react-icons

Note: @tippyjs/react and tippy.js (used internally by the Tooltip) ship as regular dependencies of this library, so they're installed automatically — no need to add them yourself.

Color Customization with CSS Variables

This library supports overriding component colors using CSS custom properties (variables). You can define these variables in your project's global CSS or stylesheets to customize the appearance of components without modifying the library code. This is particularly useful for theming and maintaining consistency with your application's design system.

To use this feature:

  1. Define the CSS variables in your project's root styles (e.g., in a global CSS file or via styled-components' createGlobalStyle).
  2. The library's components will automatically pick up these variables if they are set on the :root element or a parent container.

Note: These variables are optional. If not defined, the components will fall back to their default styled-components theme values, which are derived from the project's src/stylesheets/palette.ts file.

Available CSS Variables

The following table lists the supported CSS variables for color overriding, extracted from src/stylesheets/palette.ts. Each variable corresponds to a specific color aspect used in the components (e.g., neutrals, brands, semantics). The "Maps to BBB Core Variable" column indicates if the variable aligns with a standard BBB core color (based on the file's comments). The "Default Value" column shows the fallback color used if the variable is not set.

Variable NameMaps to BBB Core VariableDefault Value
--color-neutral-2No#717C91
--color-neutral-3No#B0BDC9
--color-neutral-4No#DCE4EC
--color-neutral-whiteNo#FFFFFF
--color-light-grayNo#F4F6FA
--color-grayNo#4E5A66
--color-dark-grayNo#393C48
--color-brand-1No#0F70D7
--color-brand-2No#0F70D7
--color-brand-3No#0F70D7
--color-brand-lightYes (--color-blue-aux)#E5EFFB
--color-brand-auxYes (--color-brand-aux)#E5EFFB
--color-successNo#2DD36F
--color-warningNo#F59240
--color-errorYes (--color-danger)#DF2721
--color-error-darkYes (--color-danger-dark)#AE1010
--color-background-whiteNo#FFFFFF
--color-background-lightNo#F4F6FA
--color-background-blueNo#E5EFFB
--color-border-defaultNo#B0BDC9
--color-border-selectedNo#0F70D7
--color-border-errorNo#DF2721
--color-border-defaultYes (--default-border)#B0BDC9
--color-text-defaultNo#393C48
--color-text-lightNo#717C91
--color-icon-defaultNo#717C91
--color-icon-blueNo#0F70D7
--color-icon-whiteNo#FFFFFF
--color-hover-darkNo#0C57A7
--color-hover-lightNo#D4E5FA
--color-hover-neutralNo#DCE4EC
--color-border-focus-ringNorgba(29, 101, 212, 0.15)
--color-icon-default-darkNorgba(255, 255, 255, 0.35)
--color-overlayNorgba(0, 0, 0, 0.75)
--color-shadow-defaultNorgb(0 35 11 / 20%)
--color-user-youNo#19237C

Example Usage:

:root {
  --color-primary: #ff5733; /* Override primary brand color to a custom orange */
  --color-text-default: #333333; /* Darker text for better contrast */
}

If you need to override colors for specific components or add new variables, refer to the component's styles.ts file for implementation details.

Importing Color Tokens in JS

In addition to CSS variables, the same color tokens used internally by every component are also exported as a nested colors object, for use directly in JS/TS (e.g. in your own styled-components):

// From the package root
import { colors } from '@bigbluebutton/bbb-ui-components-react';

// Or from the dedicated, tree-shakeable subpath
import { colors } from '@bigbluebutton/bbb-ui-components-react/colors';

const StyledDiv = styled.div`
  color: ${colors.text.default};
  background: ${colors.background.white};
`;

colors is grouped the same way as the table above: neutral, brand, semantic, background, border, text, icon, hover, overlay, shadow, user.

Installation

You can install the library directly from npm:

npm install @bigbluebutton/bbb-ui-components-react

Local Development

If you want to build the library locally or contribute:

Building the bundle

nvm use
npm install
npm run build

When developing and testing locally with npm link, you may need to adjust your Webpack configuration to ensure compatibility with styled-components and react, which do not handle multiple instances well. Add the following alias configuration to the project that uses this library:

resolve: {
  alias: {
    'styled-components': path.resolve('./node_modules/styled-components'),
    react: path.resolve('./node_modules/react'),
    'react-dom': path.resolve('./node_modules/react-dom'),
  },
}

版本与发布记录

@bigbluebutton/bbb-ui-components-react 共发布 6 个版本,首次发布于 2026/07/22;过去 12 个月发布了 6 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.10.0latest2026/10/2712 天前
0.9.02026/10/071 个月前
0.8.02026/09/301 个月前
0.7.02026/08/192 个月前
0.6.02026/07/283 个月前
0.5.02026/07/223 个月前

关于 @bigbluebutton/bbb-ui-components-react 的常见问题

@bigbluebutton/bbb-ui-components-react 是什么?

This repository contains a library of reusable React components extracted from the main BigBlueButton (BBB) project. These components provide a consistent and customizable interface that can be reused

如何安装 @bigbluebutton/bbb-ui-components-react?

在项目目录运行 npm install @bigbluebutton/bbb-ui-components-react,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^18.2.0)、react-dom(^18.2.0)、prop-types(^15.8.1)、react-icons(^5.5.0)、react-modal(>=3.16.1)、@mui/material(^6.4.9 || ^7.0.0)、@emotion/react(^11.13.0)、@emotion/styled(^11.13.0)、styled-components(>=5.3.0)、@mui/icons-material(^6.4.9 || ^7.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@bigbluebutton/bbb-ui-components-react 支持 TypeScript 吗?

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

@bigbluebutton/bbb-ui-components-react 支持 ESM 还是 CommonJS?

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

@bigbluebutton/bbb-ui-components-react 可以商用吗?

@bigbluebutton/bbb-ui-components-react 使用 LGPL-3.0 许可。弱 Copyleft:作为库被调用时通常不要求开源你自己的代码,但修改库本身需以 LGPL 开源;前端打包合并后的适用边界存在不同理解。以上为概括,不构成法律意见,请以许可原文为准。

@bigbluebutton/bbb-ui-components-react 的下载量有多少?

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

@bigbluebutton/bbb-ui-components-react 还在维护吗?

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