Skip to content
AnswerWell geo Documentation

Research · 7 min read · Answerwell

Meeting UI Kit Web Components, Design System Spacing, and Sidebar State

How Cloudflare RealtimeKit UI Kit web components work, RTK spacing tokens, rtkStateUpdate toggles, and where to look up each tag in the API reference.

This page summarises Cloudflare RealtimeKit Humans UI Kit documentation: custom elements named rtk-*, optional wrappers for React, Angular, iOS, and Android, and the RTK Design System spacing scale. If you are building a video meeting, livestream, or chat surface and want ready-made controls instead of styling everything from scratch, these components are the documented building blocks.

RTK UI Kit: what the web components are for

Section titled “RTK UI Kit: what the web components are for”

RealtimeKit’s UI Kit is a large set of meeting UI primitives—shell (rtk-meeting), stage and grids, control bar, chat, settings, plugins, AI helpers, and debug views—exposed mainly as HTML custom elements. Typical “basic usage” in the reference is a single tag in markup, for example the root shell:

<rtk-meeting></rtk-meeting>

The same pattern appears across the core reference for rtk-chat, rtk-controlbar, rtk-stage, and dozens of other tags. Deeper props, events, and styling for each tag live on that tag’s own API page—this wiki page explains how the kit fits together, not every parameter.

Layer Role Where documented
rtk-ui-provider Theming / context for UI kit usage Core web components
rtk-meeting Top-level meeting container Core
Grids & stage Video layout (rtk-grid, rtk-mixed-grid, rtk-spotlight-grid, …) e.g. rtk-grid, rtk-stage
Control & toggles Mic, camera, screen share, PiP, recording, fullscreen e.g. rtk-mic-toggle, rtk-fullscreen-toggle
Sidebars & chat Chat UI, participants, plugins, settings e.g. rtk-sidebar, rtk-chat-messages-ui
AI & captions AI panel, transcriptions, caption toggle e.g. rtk-ai, rtk-transcripts
Lifecycle screens Setup, waiting, idle, ended e.g. rtk-setup-screen, rtk-ended-screen

On mobile, the same product surfaces sometimes use native UI (bottom sheets / fragments) instead of a custom element—for example RtkChatBottomSheet on Android. On React, many controls have PascalCase wrappers (e.g. RtkChatToggle) with the same behaviour as the core rtk-* tags.

RTK Design System spacing: CSS variables for layout

Section titled “RTK Design System spacing: CSS variables for layout”

Spacing in the UI kit is not ad hoc padding on each component: it follows the RTK Design System spacing scale, implemented as CSS custom properties such as --rtk-space-*.

The spacing scale is used for setting width, height, margins, paddings, positions etc. throughout the components.

— Cloudflare, Design System — Spacing

The default value for the spacing scale base is 4px.
Rest of the values are calculated with this base, set to –rtk-space-1.
Current spacing scale ranges from 0 to 96.

— Cloudflare, Design System — Spacing

In practice, token 1 equals 4px (--rtk-space-1: 4px), and higher steps multiply from that base up through the documented range (0–96). Components that “follow the RTK Design System” (see rtk-button, rtk-switch, rtk-tooltip) rely on these tokens for consistent density. Custom layout around RTK components should prefer --rtk-space-* over hard-coded pixel margins so your shell aligns with kit internals.

Several primitives state design-system compliance explicitly—for example:

A button that follows RTK Design System.

— Cloudflare, rtk-button

A versatile button that follows the RTK Design System. Supports multiple styles, states, and sizes.

— Cloudflare, RtkButton (iOS)

How to add an rtk-* component: basic usage pattern

Section titled “How to add an rtk-* component: basic usage pattern”

For most core tags, the documented entry point is drop the element into your template—no separate “getting started” snippet in the cluster beyond the tag itself.

Examples from the reference:

Your integration work (outside the scope of these stubs) is wiring RealtimeKit core meeting state—livestream, plugins, store—into the UI. The UI kit docs in this cluster focus on presentation components; behaviour hooks appear on specific toggles and on core modules such as RTKLivestream and RTKStore.

Android: fragments and bottom sheets instead of tags

Section titled “Android: fragments and bottom sheets instead of tags”

On Android, several flows use Kotlin APIs rather than custom elements—for example chat:

val rtkChatBottomSheet = RtkChatBottomSheet()
rtkChatBottomSheet.show(fragmentManager, "CHAT_TAG")

— pattern from RtkChatBottomSheet. Similar show(fragmentManager, …) usage appears for plugins and settings bottom sheet. Setup can be added as a fragment per RtkSetupFragment.

Several toolbar buttons do not only flip local UI—they emit a shared rtkStateUpdate event with a small payload so the meeting shell can open the right sidebar or panel. Behaviour is consistent across core and React docs.

A button which toggles visibility of chat. You need to pass the meeting object to it to see the unread messages count badge. When clicked it emits a rtkStateUpdate event with the data:

{ activeSidebar: boolean; sidebar: 'chat' }

— Cloudflare, rtk-chat-toggle

The same text appears on RtkChatToggle (React). Implication: without binding the meeting object, the toggle may work visually but the unread count badge will not.

Control Payload on rtkStateUpdate Reference
rtk-participants-toggle activeSidebar, sidebar: 'participants' Core
rtk-plugins-toggle activeSidebar, sidebar: 'plugins' Core
rtk-more-toggle activeMoreMenu: boolean Core
rtk-settings-toggle activeSettings: boolean Core

Quotes for participants (core):

A button which toggles visibility of participants. When clicked it emits a rtkStateUpdate event with the data:

{ activeSidebar: boolean; sidebar: 'participants' }

— Cloudflare, rtk-participants-toggle

For plugins:

{ activeSidebar: boolean; sidebar: 'plugins' }

— Cloudflare, rtk-plugins-toggle

For settings:

{ activeSettings: boolean; }

— Cloudflare, rtk-settings-toggle

Common conclusion: treat rtk-sidebar / rtk-sidebar-ui as the consumer of these events—your app should listen for rtkStateUpdate and set sidebar visibility from activeSidebar and sidebar, or activeSettings / activeMoreMenu, rather than assuming the button alone mounts the panel.

A button which toggles full screen mode for any existing rtk-meeting component in the DOM.

— Cloudflare, rtk-fullscreen-toggle

Fullscreen targeting is global to the DOM: there must be an rtk-meeting instance present, not only isolated child widgets.

Chat, media, AI, and debugger components (when to use what)

Section titled “Chat, media, AI, and debugger components (when to use what)”

Chat splits into composition pieces—rtk-chat-composer-view, rtk-chat-message, rtk-file-message, rtk-emoji-picker—and aggregate UIs such as rtk-chat-messages-ui and rtk-chat. Use granular tags when you customize layout; use aggregate tags when you want a pre-wired block.

Media layout choices include rtk-simple-grid, rtk-audio-grid, rtk-screenshare-view, and rtk-livestream-player. Livestream control at the SDK layer is RTKLivestream:

The RTKLivestream module represents the state of the current livestream, and allows to start/stop live streams.

— Cloudflare, RTKLivestream

with .start([livestreamConfig]) and .stop() documented on the same page.

AI-related UI tags in this cluster include rtk-ai, rtk-ai-toggle, and rtk-ai-transcriptions—each documented with the same minimal custom-element usage pattern; pair them with rtk-caption-toggle and transcript views rtk-transcript / rtk-transcripts when building caption-heavy experiences.

Debugging uses dedicated kit components: rtk-debugger, rtk-debugger-video, rtk-debugger-audio, rtk-debugger-system, and rtk-debugger-toggle. These are the documented in-app diagnostics surfaces when media or signalling misbehaves.

The UI kit sits beside Humans core modules referenced in the same cluster:

Module Purpose in this cluster Link
RTKStore getAll(), clear(), populate(data) for stored meeting UI state RTKStore
RTKPlugin activateForSelf() / deactivateForSelf() on plugin instances RTKPlugin
RTKPip Picture-in-picture module entry RTKPip
RTKSelf Local participant surface (e.g. cleanupEvents()) RTKSelf

RTKStore documents, for example, that store.getAll() returns RTKStoreData, and store.clear() clears all data in the store—relevant when resetting UI state between meetings or tests.

Plugins UI (rtk-plugins, rtk-plugin-main) connects to this core plugin model; toggling the plugins sidebar uses the sidebar: 'plugins' payload described above.

  1. Using toggle buttons without handling rtkStateUpdate — Chat, participants, and plugins toggles only document the event payload; something in your tree must apply it to rtk-sidebar or equivalent layout.
  2. Omitting the meeting object on chat toggle — Unread badge behaviour is explicitly tied to passing the meeting object (rtk-chat-toggle).
  3. Fullscreen toggle without rtk-meeting in the DOM — rtk-fullscreen-toggle searches for an existing meeting component globally.
  4. Mixing spacing units — Overrides with raw pixels while internals use --rtk-space-* from the design system often misalign control bars and sidebars.
  5. Wrong platform doc — Implementing Android with web-component tags when the reference shows RtkSettingsFragment or bottom sheets leads to missing integration paths.
  1. Open the official page for each tag you embed (for example rtk-meeting) and confirm your markup matches the documented Basic Usage custom element.

  2. In the browser devtools, inspect computed styles on kit layout and verify spacing uses --rtk-space-* tokens per the Design System — Spacing (base 4px on --rtk-space-1).

  3. Click sidebar toggles (rtk-chat-toggle, rtk-participants-toggle, rtk-plugins-toggle) and confirm your handler receives rtkStateUpdate with the documented payload fields.

  4. Add rtk-debugger or rtk-debugger-toggle in a staging build and use the debugger audio/video/system subviews when diagnosing media issues.

  5. You can check automatically in Answerwell (our tool): https://answerwell.org/workspace

If something on this page does not match the Cloudflare docs or your integration behaves differently, email yimasynthetic@gmail.com with the page URL and the exact sentence or code snippet you believe is wrong, and we will correct or clarify it.