LevelChatLevelChatDocs
NoiseSuppressionToggle

Components

NoiseSuppressionToggle

One switch to flip noise suppression on/off for the local outgoing mic.

NoiseSuppressionToggle wraps the SDK's noiseSuppression namespace with an accessible role="switch" control. Optimistic state with revert-on- error; renders a disabled "Not supported" state when the SDK reports the browser can't run the DSP (e.g. Safari < 17).

Install

pnpm add @levelchat/react-components @levelchat/web

Requirements

  • Reactreact and react-dom ^18 || ^19 (peer dependency).
  • LevelChat Web SDK@levelchat/web ^0.2.4 (peer dependency, wires hook-driven mode to the live Room).
  • Provider — wrap the tree in <LevelChatProvider> from @levelchat/web-react so hook-driven mode can subscribe to room events. Prop-driven demos work without it.
  • Styles — import the brand tokens + kit stylesheet exactly once at the app entry, before any kit component renders.

In Next.js (App Router), import the stylesheets at the top of your root layout:

TypeScript (TSX)
// app/layout.tsx
import '@levelchat/brand/tokens.css';
import '@levelchat/react-components/styles.css';

In Vite (or any plain React app), import them at the top of your entry module:

TypeScript (TSX)
// src/main.tsx
import '@levelchat/brand/tokens.css';
import '@levelchat/react-components/styles.css';

Basic usage

Capability detection

Never branch on navigator.userAgent here — trust the SDK's supportedflag, which checks the browser's AudioContext + AudioWorkletavailability at runtime. When unsupported, the switch is disabled with aria-describedby pointing at "Not supported in this browser".

Props

PropTypeDefaultNotes
renderLabel(state) => ReactNode"Noise suppression"Override the label (i18n).
hideStatusbooleanfalseHide the descriptive text under the switch.