@100mslive/roomkit-react

中文文档
0.6.3发布于 2026/10/01MITTypeScriptESM + CJS构建来源已验证近 30 天下载 2.9万

Banner

原始使用文档
文档目录10 节
  1. Installation
  2. Usage
  3. Using room code
  4. Using authToken
  5. Customisation
  6. Understanding the Structure
  7. Major Components in Prebuilt
  8. Customising the Styles
  9. Contributing
  10. Community & Support

Banner

Lint, Test and Build Bundle Size License Tree shaking

Room Kit React Library

100ms Room Kit provides simple & easy to use UI components to build Live Streaming & Video Conferencing experiences in your apps.

Installation

// npm
npm install @100mslive/roomkit-react@latest --save

// yarn
yarn add @100mslive/roomkit-react@latest

Usage

Using room code

import { HMSPrebuilt } from '@100mslive/roomkit-react'

export default App() {
    return (
        <HMSPrebuilt roomCode={<room-code>} />
    );
}

Using authToken

import { HMSPrebuilt } from '@100mslive/roomkit-react'

export default App() {
    return (
        <HMSPrebuilt authToken={<auth-token>} />
    );
}

For additional props, refer the docs

Customisation

While we offer a no-code way to customize Prebuilt, you can fork your copy of the Prebuilt component and make changes to the code to allow for more fine-tuning.

Prebuilt customisations are available on 100ms Dashboard.

Understanding the Structure

The src folder contains all the components, Button, Accordion etc. The Prebuilt folder contains the full Prebuilt implementation. App.tsx is the entry point for the Prebuilt which contains the HMSPrebuilt component.

Major Components in Prebuilt

ComponentDescription
RoomLayoutProviderThis is a context that contains the configuration from the dashboard customiser. Whatever changes are made in the dashboard customiser are available the next time you join.
AppStateContextContains the logic to switch between different screens, for example, Preview to Meeting, Meeting to Leave. These transitions are based on the roomState that is available from the reactive store (useHMSStore(selectHMSRoomState)).
PreviewScreenContains the Preview implementation. Contains the Video tile, video, audio toggles and Virtual background and settings along with the name input.
ConferenceScreenThis contains the screen once you finish Preview and enter the meeting. This contains the header and footer and the main content.
VideoStreamingSectionThis is the component that contains the main video rendering components and a sidebar (Interactive features like Chat and Polls are displayed here)
LeaveScreenThis is the screen that is shown when you leave the meeting

Customising the Styles

Base Config has all the variables that you can use. Any changes you want for the theme can be made here. Most likely no additional changes will be required unless you want to introduce new variables.

When HMSThemeProvider is used at the top level, all the variables will be available for all the children under this component tree.

For components created using the base components like Box, Flex, Button etc, css Prop is available to modify the styles. Within the css prop, you can access the variables from the base config.

Contributing

  • Make sure whatever new Component/file you create is in Typescript.

  • Don't forget to add data-testid for actionables like buttons, menus etc.

  • Setup proper tooling (ESLint and Prettier) in your editor.

  • yarn lint will be run before you push the changes, so whenever a push fails, check if there are any lint errors.

Read this doc for the coding guidelines.

Community & Support

  • GitHub Issues - Submit any bugs or errors you encounter using the Web SDKs.
  • Dashboard - ask questions to get help from the 100ms team.
  • Contact - Reach out to 100ms team to get pricing information, understand how we can help you go live, or to learn more about the platform.

版本与发布记录

@100mslive/roomkit-react 共发布 475 个版本,首次发布于 2023/07/25;过去 12 个月发布了 80 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.6.3latest2026/10/011 个月前
0.6.3-alpha.1alpha2026/10/011 个月前
0.6.3-alpha.02026/09/291 个月前
0.6.22026/09/221 个月前
0.6.2-alpha.62026/09/221 个月前
0.6.2-alpha.52026/09/221 个月前

关于 @100mslive/roomkit-react 的常见问题

如何安装 @100mslive/roomkit-react?

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

@100mslive/roomkit-react 支持 TypeScript 吗?

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

@100mslive/roomkit-react 支持 ESM 还是 CommonJS?

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

@100mslive/roomkit-react 可以商用吗?

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

@100mslive/roomkit-react 的下载量有多少?

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

@100mslive/roomkit-react 还在维护吗?

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